From 6fe7d3fd60adde9037b2cb1104a41e486d1513b9 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 3 May 2021 14:40:40 +0200 Subject: [PATCH] Fixes a useless warning. Fixes #11525 --- 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 8798052e7487e5..87bca772f46e5d 100644 --- a/src/transformers/generation_utils.py +++ b/src/transformers/generation_utils.py @@ -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: