Fix seq2seq example test (#7518)

* Fix seq2seq example test

* Fix bad copy-paste

* Also save the state
This commit is contained in:
Sylvain Gugger
2020-10-01 14:13:29 -04:00
committed by GitHub
parent 29baa8fabe
commit bdcc4b78a2
3 changed files with 5 additions and 4 deletions

View File

@@ -276,6 +276,7 @@ def main():
# For convenience, we also re-save the tokenizer to the same directory,
# so that you can share your model easily on huggingface.co/models =)
if trainer.is_world_process_zero():
trainer.state.save_to_json(os.path.join(training_args.output_dir, "trainer_state.json"))
tokenizer.save_pretrained(training_args.output_dir)
# Evaluation