facebookresearch / XLM

PyTorch original implementation of Cross-lingual Language Model Pretraining.
Other
2.87k stars 495 forks source link

how to save the entire model instead of just the model parameters #360

Open vicky-yuan opened 1 year ago

vicky-yuan commented 1 year ago

I had a problem when I was pre-training with the domain multilingual. After training, my folder was this, but I found that the 'checkpoint.pth' only saved the parameters of the model.

hypotheses best-valid_en_mlm_ppl.pth 9.03M checkpoint.pth 25.03M params.pkl 2KB train.log 23KB

Actually, I want to save the entire model content, what should I do? I tried to rewrite the function 'save_checkpoint' to save the entire model, but I failed. Looking forward to your reply, thank you!