Skip to content

Commit

Permalink
community: fix error in sambastudio embeddings (langchain-ai#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 and Sheepsta300 committed Oct 1, 2024
1 parent 3741065 commit 6833ebd
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 6833ebd

Please sign in to comment.