community: fix error in sambastudio embeddings (#26260)

fix error in samba studio embeddings  result unpacking
This commit is contained in:
Jorge Piedrahita Ortiz 2024-09-19 08:57:04 -05:00 committed by GitHub
parent 37b72023fe
commit 55b641b761
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -213,7 +213,7 @@ class SambaStudioEmbeddings(BaseModel, Embeddings):
)
try:
if params.get("select_expert"):
embedding = response.json()["predictions"][0]
embedding = response.json()["predictions"]
else:
embedding = response.json()["predictions"]
embeddings.extend(embedding)
@ -299,7 +299,7 @@ class SambaStudioEmbeddings(BaseModel, Embeddings):
)
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: