Merge pull request #1928 from danielaskdd/main
Fix: Update OpenAI embedding handling for both list and base64 embeddings
This commit is contained in:
commit
f1c6a4ed94
2 changed files with 4 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -70,4 +70,5 @@ gui/
|
|||
test_*
|
||||
|
||||
# Cline files
|
||||
memory-bank
|
||||
memory-bank/
|
||||
|
|
|
|||
|
|
@ -477,7 +477,9 @@ async def openai_embed(
|
|||
)
|
||||
return np.array(
|
||||
[
|
||||
np.frombuffer(base64.b64decode(dp.embedding), dtype=np.float32)
|
||||
np.array(dp.embedding, dtype=np.float32)
|
||||
if isinstance(dp.embedding, list)
|
||||
else np.frombuffer(base64.b64decode(dp.embedding), dtype=np.float32)
|
||||
for dp in response.data
|
||||
]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue