Skip to content

Commit

Permalink
fix tei embedding and tei reranking bug (#1256)
Browse files Browse the repository at this point in the history
Signed-off-by: minmin-intel <[email protected]>
Co-authored-by: Abolfazl Shahbazi <[email protected]>
  • Loading branch information
minmin-intel and ashahba authored Feb 5, 2025
1 parent 4ede405 commit fa01f46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions comps/embeddings/src/integrations/tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async def invoke(self, input: EmbeddingRequest) -> EmbeddingResponse:
raise TypeError("Unsupported input type: input must be a string or list of strings.")
response = await self.client.post(
json={"input": texts, "encoding_format": input.encoding_format, "model": input.model, "user": input.user},
model=f"{self.base_url}/v1/embeddings",
task="text-embedding",
)
embeddings = json.loads(response.decode())
Expand Down
1 change: 1 addition & 0 deletions comps/rerankings/src/integrations/tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ async def invoke(

response = await self.client.post(
json={"query": query, "texts": docs},
model=f"{self.base_url}/rerank",
task="text-reranking",
)

Expand Down

0 comments on commit fa01f46

Please sign in to comment.