Skip to content

Commit

Permalink
community: fix error in sambastudio embeddings (#26260)
Browse files Browse the repository at this point in the history
fix error in samba studio embeddings  result unpacking
  • Loading branch information
jhpiedrahitao authored Sep 19, 2024
1 parent 37b7202 commit 55b641b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/community/langchain_community/embeddings/sambanova.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def embed_documents(
)
try:
if params.get("select_expert"):
embedding = response.json()["predictions"][0]
embedding = response.json()["predictions"]
else:
embedding = response.json()["predictions"]
embeddings.extend(embedding)
Expand Down Expand Up @@ -299,7 +299,7 @@ def embed_query(self, text: str) -> List[float]:
)
try:
if params.get("select_expert"):
embedding = response.json()["predictions"][0][0]
embedding = response.json()["predictions"][0]
else:
embedding = response.json()["predictions"][0]
except KeyError:
Expand Down

0 comments on commit 55b641b

Please sign in to comment.