Skip to content

Commit

Permalink
Remove extra "max_length is reached." from InfNaNLogitsProcessor do…
Browse files Browse the repository at this point in the history
…cumentation (huggingface#21634)

* Fix typo in documentation.

* Remove trailing words typo in documentation.
  • Loading branch information
mmcdermott authored Feb 14, 2023
1 parent 26ef0f1 commit 762dda4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/generation/logits_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,7 @@ def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> to
class InfNanRemoveLogitsProcessor(LogitsProcessor):
r"""
[`LogitsProcessor`] that removes all `nan` and `inf` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method. `max_length` is
reached.
the logits processor should only be used if necessary since it can slow down the generation method.
"""

def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
Expand Down

0 comments on commit 762dda4

Please sign in to comment.