From 6c8d4d98027604ab527d6b7cd54e365704ca4a36 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 19 Apr 2021 17:33:11 +0200 Subject: [PATCH] There should not be a warning within `generate`. `max_length` is ok there. --- src/transformers/generation_utils.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/transformers/generation_utils.py b/src/transformers/generation_utils.py index ffc841dbdbf877..e5b987b5f7d10d 100644 --- a/src/transformers/generation_utils.py +++ b/src/transformers/generation_utils.py @@ -997,12 +997,6 @@ def generate( stopping_criteria = self._get_stopping_criteria( max_length=max_length, max_time=max_time, stopping_criteria=stopping_criteria ) - 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, - ) - validate_stopping_criteria(stopping_criteria, max_length) if is_greedy_gen_mode: if num_return_sequences > 1: