"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "e516a34a158593f82b6f22dc1e568ff8996f0389"
Unverified Commit bcedd0a4 authored by regisss's avatar regisss Committed by GitHub
Browse files

Save the tokenizer and image preprocessor after training a model with the...

Save the tokenizer and image preprocessor after training a model with the contrastive image-text example (#23035)

Save tokenizer and image preprocessor
parent 85e3d7b6
...@@ -510,6 +510,8 @@ def main(): ...@@ -510,6 +510,8 @@ def main():
checkpoint = last_checkpoint checkpoint = last_checkpoint
train_result = trainer.train(resume_from_checkpoint=checkpoint) train_result = trainer.train(resume_from_checkpoint=checkpoint)
trainer.save_model() trainer.save_model()
tokenizer.save_pretrained(training_args.output_dir)
image_processor.save_pretrained(training_args.output_dir)
trainer.log_metrics("train", train_result.metrics) trainer.log_metrics("train", train_result.metrics)
trainer.save_metrics("train", train_result.metrics) trainer.save_metrics("train", train_result.metrics)
trainer.save_state() trainer.save_state()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment