Skip to content

Commit

Permalink
fix(rag): Fix rerank bug of EmbeddingRetriever (#1499)
Browse files Browse the repository at this point in the history
Co-authored-by: dong <[email protected]>
  • Loading branch information
FOkvj and dong authored May 9, 2024
1 parent b38305b commit 87a67cc
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 87a67cc

Please sign in to comment.