Przeglądaj źródła

Fix: rerank with YoudaoRerank issue. (#6396)

### What problem does this PR solve?

Fix rerank with YoudaoRerank issue,"'YoudaoRerank' object has no
attribute '_dynamic_batch_size'"


![1742541235](https://github.com/user-attachments/assets/9ed304c7-317a-440e-acff-fe895fc20f07)


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.18.0
zhou 7 miesięcy temu
rodzic
commit
a6aed0da46
No account linked to committer's email address
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2
    0
      rag/llm/rerank_model.py

+ 2
- 0
rag/llm/rerank_model.py Wyświetl plik

@@ -194,6 +194,8 @@ class YoudaoRerank(DefaultRerank):
"maidalun1020", "InfiniFlow"))

self._model = YoudaoRerank._model
self._dynamic_batch_size = 8
self._min_batch_size = 1

def similarity(self, query: str, texts: list):
pairs = [(query, truncate(t, self._model.max_length)) for t in texts]

Ładowanie…
Anuluj
Zapisz