Skip to content

Commit

Permalink
Fixes a useless warning. (#11566)
Browse files Browse the repository at this point in the history
Fixes #11525
  • Loading branch information
Narsil authored May 3, 2021
1 parent 87dd1a0 commit 1e8e068
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/transformers/generation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,12 +959,6 @@ def generate(
)

stopping_criteria = self._get_stopping_criteria(max_length=max_length, max_time=max_time)
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList(MaxLengthCriteria(max_length=max_length))` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)

if is_greedy_gen_mode:
if num_return_sequences > 1:
Expand Down

0 comments on commit 1e8e068

Please sign in to comment.