fix bug 994 ,991 (#1004)

### What problem does this PR solve?

#994 
#991 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
KevinHuSh 2024-05-31 09:24:24 +08:00 committed by GitHub
parent 4f4d8baf49
commit dc7afe46fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ EmbeddingModel = {
"Ollama": OllamaEmbed,
"OpenAI": OpenAIEmbed,
"Xinference": XinferenceEmbed,
"Tongyi-Qianwen": DefaultEmbedding,#QWenEmbed,
"Tongyi-Qianwen": QWenEmbed,
"ZHIPU-AI": ZhipuEmbed,
"FastEmbed": FastEmbed,
"Youdao": YoudaoEmbed,

View File

@ -71,7 +71,7 @@ class DefaultRerank(Base):
res = []
for i in range(0, len(pairs), batch_size):
scores = self._model.compute_score(pairs[i:i + batch_size], max_length=2048)
scores = sigmoid(np.array(scores))
scores = sigmoid(np.array(scores)).tolist()
res.extend(scores)
return np.array(res), token_count