`Seq2SeqTrainer` set max_length and num_beams only when non None  (#12899)
`Seq2SeqTrainer` set max_length and num_beams only when non None  (#12899)

* set max_length and num_beams only when non None

* fix instance variables

* fix code style
huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers