소스 검색

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
No account linked to committer's email address
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3
    0
      rag/llm/rerank_model.py

+ 3
- 0
rag/llm/rerank_model.py 파일 보기

@@ -15,6 +15,7 @@
#
import re
import threading
from collections.abc import Iterable
from urllib.parse import urljoin

import requests
@@ -135,6 +136,8 @@ class DefaultRerank(Base):
else:
scores = self._model.compute_score(batch_pairs, max_length=max_length)
scores = sigmoid(np.array(scores)).tolist()
if not isinstance(scores, Iterable):
scores = [scores]
return scores

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

Loading…
취소
저장