Skip to content

Commit

Permalink
fix(rag): Fix rerank bug of EmbeddingRetriever (eosphoros-ai#1499)
Browse files Browse the repository at this point in the history
Co-authored-by: dong <dongzhancai@iie2.com>
  • Loading branch information
2 people authored and Hopshine committed Sep 10, 2024
1 parent 75c3eb1 commit c4d47ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dbgpt/rag/retriever/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _retrieve_with_score(
new_candidates_with_score = cast(
List[Chunk], reduce(lambda x, y: x + y, candidates_with_score)
)
new_candidates_with_score = self._rerank.rank(new_candidates_with_score)
new_candidates_with_score = self._rerank.rank(new_candidates_with_score, query)
return new_candidates_with_score

async def _aretrieve(
Expand Down Expand Up @@ -207,7 +207,9 @@ async def _aretrieve_with_score(
"rerank_cls": self._rerank.__class__.__name__,
},
):
new_candidates_with_score = self._rerank.rank(new_candidates_with_score)
new_candidates_with_score = self._rerank.rank(
new_candidates_with_score, query
)
return new_candidates_with_score

async def _similarity_search(
Expand Down

0 comments on commit c4d47ae

Please sign in to comment.