diff --git a/docs/source/en/main_classes/text_generation.md b/docs/source/en/main_classes/text_generation.md index d879669bcab8..62d06b390c45 100644 --- a/docs/source/en/main_classes/text_generation.md +++ b/docs/source/en/main_classes/text_generation.md @@ -41,4 +41,4 @@ like token streaming. [[autodoc]] GenerationMixin - generate - - compute_transition_scores + - compute_transition_scores \ No newline at end of file diff --git a/src/transformers/generation/configuration_utils.py b/src/transformers/generation/configuration_utils.py index d224eb96174a..483ff2bce452 100644 --- a/src/transformers/generation/configuration_utils.py +++ b/src/transformers/generation/configuration_utils.py @@ -105,8 +105,9 @@ class GenerationConfig(PushToHubMixin): > Parameters that control the length of the output max_length (`int`, *optional*, defaults to 20): - The maximum length the generated tokens can have. Corresponds to the length of the input prompt + - `max_new_tokens`. Its effect is overridden by `max_new_tokens`, if also set. + `max_new_tokens` is recommended for controlling how many tokens the model generates. + `max_length` remains for backward compatibility. + max_new_tokens (`int`, *optional*): The maximum numbers of tokens to generate, ignoring the number of tokens in the prompt. min_length (`int`, *optional*, defaults to 0):