Reading more, it appears that max_target_length and its 3 friends are there specifically to truncate the dataset records, but there are simply no user overrides for generate()s: (edit this is not so, see my later comment as I found it after closer inspection, but the rest of this comment is valid)


max_length ( int , optional, defaults to 20) – The maximum length of the sequence to be generated.

min_length ( int , optional, defaults to 10) – The minimum length of the sequence to be generated.

So most likely new flags need to be added that override these 2 model.config's defaults.
I see currently the script overrides these 4 model.config's defaults:
  --encoder_layerdrop ENCODER_LAYERDROP
                        Encoder layer dropout probability. Goes into
                        model.config.
  --decoder_layerdrop DECODER_LAYERDROP
                        Decoder layer dropout probability. Goes into
                        model.config.
  --dropout DROPOUT     Dropout probability. Goes into model.config.
  --attention_dropout ATTENTION_DROPOUT
                        Attention dropout probability. Goes into model.config.

So perhaps what’s needed is generate_max_length and generate_min_length
or perhaps min_gen_length and max_gen_length to somewhat match:

–max_source_length MAX_SOURCE_LENGTH
–max_target_length MAX_TARGET_LENGTH

as these aren’t very clear on what they apply to.