Pārlūkot izejas kodu

fix: TypeError: only length-1 arrays can be converted to Python scalars (#3211)

### What problem does this PR solve?
fix "TypeError: only length-1 arrays can be converted to Python scalars"
while using cohere embedding model.

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)


![image](https://github.com/user-attachments/assets/2c21a69f-cd76-4d25-b320-058964812db8)
tags/v0.14.0
ksztone-huanggonghao pirms 1 gada
vecāks
revīzija
0dff64f6ad
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1
    1
      rag/llm/embedding_model.py

+ 1
- 1
rag/llm/embedding_model.py Parādīt failu

@@ -558,7 +558,7 @@ class CoHereEmbed(Base):
input_type="search_query",
embedding_types=["float"],
)
return np.array([d for d in res.embeddings.float]), int(
return np.array(res.embeddings.float[0]), int(
res.meta.billed_units.input_tokens
)


Notiek ielāde…
Atcelt
Saglabāt