From bcedd0a47197d7587cda97376ac8f6da301191cc Mon Sep 17 00:00:00 2001 From: regisss <15324346+regisss@users.noreply.github.com> Date: Tue, 2 May 2023 15:23:16 +0200 Subject: [PATCH] Save the tokenizer and image preprocessor after training a model with the contrastive image-text example (#23035) Save tokenizer and image preprocessor --- examples/pytorch/contrastive-image-text/run_clip.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/pytorch/contrastive-image-text/run_clip.py b/examples/pytorch/contrastive-image-text/run_clip.py index 2121602ec3..c30349c37a 100644 --- a/examples/pytorch/contrastive-image-text/run_clip.py +++ b/examples/pytorch/contrastive-image-text/run_clip.py @@ -510,6 +510,8 @@ def main(): checkpoint = last_checkpoint train_result = trainer.train(resume_from_checkpoint=checkpoint) 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.save_metrics("train", train_result.metrics) trainer.save_state()