How to resume_from_checkpoint for Seq2SeqTrainer of EncoderDecoderLM
Hi transformers developers:

First thanks to your great work!

I noticed there was a resume from checkpoint method for the Seq2SeqTrainer when the LM was BART-like out-of-the-box Seq2Seq LMs, like this:

https://github.com/huggingface/transformers/blob/fd338abdeba25cb40b27650ba2203ac6789d2776/examples/seq2seq/run_summarization.py#L529

I wonder how can I use it for a [EncoderDecoderLM](https://huggingface.co/transformers/model_doc/encoderdecoder.html), where the whole model has two parts (encoder and decoder). Should I load the checkpoint for encoder and decoder separately, or is there a nice way we can do that in one line like BART?

Thanks in advance!


Hi @DapangLiu 

The `resume_from_checkpoint` should work for any `PreTrainedModel` class. Even though `EncoderDecoder` model is initialized using two sepearte models when save it using `save_pretarined` it's saved as a single model and can be loaded using `from_pretrained`.

Make sure that your checkpoint directory contains the saved model file, the saved optimizer and scheduler (if you also want to resume that) and it should work.<|||||>Solved my problem. Thanks @patil-suraj !