mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix FlagRerank max_length issue. (#5366)
### What problem does this PR solve? #5352 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -130,12 +130,12 @@ class DefaultRerank(Base):
|
||||
|
||||
self._dynamic_batch_size = old_dynamic_batch_size
|
||||
return np.array(res)
|
||||
|
||||
|
||||
def _compute_batch_scores(self, batch_pairs, max_length=None):
|
||||
if max_length is None:
|
||||
max_length = self._model.max_length
|
||||
scores = self._model.compute_score(batch_pairs, max_length=max_length)
|
||||
scores = self._model.compute_score(batch_pairs)
|
||||
else:
|
||||
scores = self._model.compute_score(batch_pairs, max_length=max_length)
|
||||
scores = sigmoid(np.array(scores)).tolist()
|
||||
return scores
|
||||
|
||||
|
||||
Reference in New Issue
Block a user