fix: bug similarity() in YoudaoRerank (#1084)

### What problem does this PR solve?

bix fix

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Wang Baoling 2024-06-07 09:04:53 +08:00 committed by GitHub
parent dbdae8e83c
commit 722c342d56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,7 +125,7 @@ class YoudaoRerank(DefaultRerank):
scores = self._model.compute_score(pairs[i:i + batch_size], max_length=self._model.max_length)
scores = sigmoid(np.array(scores)).tolist()
if isinstance(scores, float): res.append(scores)
res.extend(scores)
else: res.extend(scores)
return np.array(res), token_count