Skip to content

Commit

Permalink
small fix for all_token_bias_pairs_are_valid internal func
Browse files Browse the repository at this point in the history
  • Loading branch information
VladOS95-cyber committed Sep 10, 2024
1 parent 2937017 commit 638ad30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/generation/logits_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def _validate_arguments(self):
)

def all_token_bias_pairs_are_valid(sequence):
(
return (
isinstance(token_bias_pair, list)
and all(isinstance(token_id, (int, np.integer)) and token_id > 0 for token_id in token_bias_pair)
or isinstance(token_bias_pair, float)
Expand Down

0 comments on commit 638ad30

Please sign in to comment.