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

Save tokenizer and image preprocessor
This commit is contained in:
regisss
2023-05-02 15:23:16 +02:00
committed by GitHub
parent 85e3d7b6a0
commit bcedd0a471

View File

@@ -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()