Length penalty for beam search
Hey everyone!

I want to reproduce T5's result on the CNN/DM summarization task. As described in the paper, T5 uses beam search with a beam width of 4 and a length penalty of α = 0.6 ([Wu et al., 2016](https://arxiv.org/abs/1609.08144)). However, I couldn't find a specific argument to set the length penalty α (which is a scaling factor for brevity penalty). Is it available somewhere?
Tagging @patil-suraj as it involves summarization.<|||||>Hi @tuvuumass , there's the `length_penalty` argument in the `generate` method, which you can use for this.
https://huggingface.co/docs/transformers/master/en/main_classes/model#transformers.generation_tf_utils.TFGenerationMixin.generate.length_penalty<|||||>@patil-suraj: Great, thanks Suraj! Is it also available for a pre-trained Pytorch model, e.g., BART?<|||||>it's in the `generate` method, which is available for all causal and seq2seq models, so yes for BART as well.<|||||>Great, thanks!