Skip to content

Commit

Permalink
community: Fixed infinity embeddings async request (#25882)
Browse files Browse the repository at this point in the history
**Description:** Fix async infinity embeddings
**Issue:** #24942  

@baskaryan, @ccurme
  • Loading branch information
djo10 authored Aug 30, 2024
1 parent f75d562 commit 862ef32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/community/langchain_community/embeddings/infinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ async def _async_request(
f"Infinity returned an unexpected response with status "
f"{response.status}: {response.text}"
)
embedding = (await response.json())["embeddings"]
embedding = (await response.json())["data"]
return [e["embedding"] for e in embedding]

async def aembed(self, model: str, texts: List[str]) -> List[List[float]]:
Expand All @@ -313,7 +313,7 @@ async def aembed(self, model: str, texts: List[str]) -> List[List[float]]:
*[
self._async_request(
session=session,
**self._kwargs_post_request(model=model, texts=t),
kwargs=self._kwargs_post_request(model=model, texts=t),
)
for t in perm_texts_batched
]
Expand Down

0 comments on commit 862ef32

Please sign in to comment.