Generate: min length can't be larger than max length (#16668)

* min length must be smaller than max length

* Update min_length in tests
This commit is contained in:
Joao Gante
2022-04-11 11:55:30 +01:00
committed by GitHub
parent 4868a830db
commit b0bf3011c1
4 changed files with 18 additions and 3 deletions

View File

@@ -102,7 +102,7 @@ class GenerationTesterMixin:
diversity_penalty=None,
):
process_kwargs = {
"min_length": input_length + 1,
"min_length": input_length + 1 if max_length is None else max_length - 1,
"bad_words_ids": [[1, 0]],
"no_repeat_ngram_size": 2,
"repetition_penalty": 1.2,