Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix: bug similarity() in YoudaoRerank (#1084)

Wang Baoling722c342d5644
diff --git a/rag/llm/rerank_model.py b/rag/llm/rerank_model.py
index 33ce26fc7d..7e6b73403f 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