Issue with finetuning a seq-to-seq model

it still continues to generate many more tokens than it should

That was exactly my observation too. Which led me to think that somehow the model is not learning EOS character (hence, the generation is not functioning as expected).

Re. prefix:

Looks like the prefix is set here: https://github.com/huggingface/transformers/blob/master/examples/seq2seq/utils.py#L243

which seems like it’s passed here:

Where self.model.config.prefix is being picked up from? Not sure.