KevinHuSh
commited on
Commit
·
d42f535
1
Parent(s):
b90dc0e
fix bug 994 ,991 (#1004)
Browse files### What problem does this PR solve?
#994
#991
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- rag/llm/__init__.py +1 -1
- rag/llm/rerank_model.py +1 -1
rag/llm/__init__.py
CHANGED
@@ -23,7 +23,7 @@ EmbeddingModel = {
|
|
23 |
"Ollama": OllamaEmbed,
|
24 |
"OpenAI": OpenAIEmbed,
|
25 |
"Xinference": XinferenceEmbed,
|
26 |
-
"Tongyi-Qianwen":
|
27 |
"ZHIPU-AI": ZhipuEmbed,
|
28 |
"FastEmbed": FastEmbed,
|
29 |
"Youdao": YoudaoEmbed,
|
|
|
23 |
"Ollama": OllamaEmbed,
|
24 |
"OpenAI": OpenAIEmbed,
|
25 |
"Xinference": XinferenceEmbed,
|
26 |
+
"Tongyi-Qianwen": QWenEmbed,
|
27 |
"ZHIPU-AI": ZhipuEmbed,
|
28 |
"FastEmbed": FastEmbed,
|
29 |
"Youdao": YoudaoEmbed,
|
rag/llm/rerank_model.py
CHANGED
@@ -71,7 +71,7 @@ class DefaultRerank(Base):
|
|
71 |
res = []
|
72 |
for i in range(0, len(pairs), batch_size):
|
73 |
scores = self._model.compute_score(pairs[i:i + batch_size], max_length=2048)
|
74 |
-
scores = sigmoid(np.array(scores))
|
75 |
res.extend(scores)
|
76 |
return np.array(res), token_count
|
77 |
|
|
|
71 |
res = []
|
72 |
for i in range(0, len(pairs), batch_size):
|
73 |
scores = self._model.compute_score(pairs[i:i + batch_size], max_length=2048)
|
74 |
+
scores = sigmoid(np.array(scores)).tolist()
|
75 |
res.extend(scores)
|
76 |
return np.array(res), token_count
|
77 |
|