mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-04 02:25:08 +00:00
fix(rag): Fix CrossEncoderRanker bug of EmbeddingRetriever (#1504)
Co-authored-by: aries_ckt <916701291@qq.com>
This commit is contained in:
@@ -219,7 +219,7 @@ class CrossEncoderRanker(Ranker):
|
||||
rank_scores = self._model.predict(sentences=query_content_pairs)
|
||||
|
||||
for candidate, score in zip(candidates_with_scores, rank_scores):
|
||||
candidate.score = score
|
||||
candidate.score = float(score)
|
||||
|
||||
new_candidates_with_scores = sorted(
|
||||
candidates_with_scores, key=lambda x: x.score, reverse=True
|
||||
|
Reference in New Issue
Block a user