Skip to content

Commit

Permalink
Fix CrossEncoderRanker (#1531)
Browse files Browse the repository at this point in the history
Co-authored-by: dong <dongzhancai@iie2.com>
Co-authored-by: Zhancai Dong <dongzhancai1@jd.com>
  • Loading branch information
3 people authored May 20, 2024
1 parent dcb1bd3 commit 04af30e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbgpt/rag/retriever/rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def rank(
Returns:
List[Chunk], reranked candidates
"""
if len(candidates_with_scores) <= 1:
return candidates_with_scores
contents = [candidate.content for candidate in candidates_with_scores]
query_content_pairs = [
[
Expand Down

0 comments on commit 04af30e

Please sign in to comment.