From 722c342d5644d6c3e0a518f1dbab8ae10861c7f0 Mon Sep 17 00:00:00 2001 From: Wang Baoling Date: Fri, 7 Jun 2024 09:04:53 +0800 Subject: [PATCH] fix: bug similarity() in YoudaoRerank (#1084) ### What problem does this PR solve? bix fix ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/rerank_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/llm/rerank_model.py b/rag/llm/rerank_model.py index 33ce26fc7..7e6b73403 100644 --- a/rag/llm/rerank_model.py +++ b/rag/llm/rerank_model.py @@ -125,7 +125,7 @@ class YoudaoRerank(DefaultRerank): scores = self._model.compute_score(pairs[i:i + batch_size], max_length=self._model.max_length) scores = sigmoid(np.array(scores)).tolist() if isinstance(scores, float): res.append(scores) - res.extend(scores) + else: res.extend(scores) return np.array(res), token_count