浏览代码

Fix: rerank issue. (#5696)

### What problem does this PR solve?

#5673

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.17.1
Kevin Hu 8 个月前
父节点
当前提交
df9b7b2fe9
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      rag/llm/rerank_model.py

+ 3
- 0
rag/llm/rerank_model.py 查看文件

# #
import re import re
import threading import threading
from collections.abc import Iterable
from urllib.parse import urljoin from urllib.parse import urljoin


import requests import requests
else: else:
scores = self._model.compute_score(batch_pairs, max_length=max_length) scores = self._model.compute_score(batch_pairs, max_length=max_length)
scores = sigmoid(np.array(scores)).tolist() scores = sigmoid(np.array(scores)).tolist()
if not isinstance(scores, Iterable):
scores = [scores]
return scores return scores


def similarity(self, query: str, texts: list): def similarity(self, query: str, texts: list):

正在加载...
取消
保存