Unverified Commit 4dce3743 authored by Pedro Cuenca's avatar Pedro Cuenca Committed by GitHub
Browse files

Fix training push_to_hub (unconditional image generation): models were not...

Fix training push_to_hub (unconditional image generation): models were not saved before pushing to hub (#868)

Fix: models were not saved before pushing to hub.
parent 52e8fdb8
......@@ -184,10 +184,9 @@ def main(args):
if epoch % args.save_model_epochs == 0 or epoch == args.num_epochs - 1:
# save the model
pipeline.save_pretrained(args.output_dir)
if args.push_to_hub:
repo.push_to_hub(commit_message=f"Epoch {epoch}", blocking=False)
else:
pipeline.save_pretrained(args.output_dir)
accelerator.wait_for_everyone()
accelerator.end_training()
......
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