mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
refine API request data processing (#1031)
### What problem does this PR solve? #1024 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -115,7 +115,7 @@ class YoudaoRerank(DefaultRerank):
|
||||
"maidalun1020", "InfiniFlow"))
|
||||
|
||||
def similarity(self, query: str, texts: list):
|
||||
pairs = [(query,truncate(t, self._model.max_length)) for t in texts]
|
||||
pairs = [(query, truncate(t, self._model.max_length)) for t in texts]
|
||||
token_count = 0
|
||||
for _, t in pairs:
|
||||
token_count += num_tokens_from_string(t)
|
||||
|
||||
Reference in New Issue
Block a user