Unverified Commit ba15fe79 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Fix push_to_hub for TPUs (#12895)

parent b3f95dce
......@@ -2515,10 +2515,11 @@ class Trainer:
Returns:
The url of the commit of your model in the given repository.
"""
if not self.args.should_save:
return
self.create_model_card(model_name=self.args.push_to_hub_model_id, **kwargs)
if self.args.should_save:
self.create_model_card(model_name=self.args.push_to_hub_model_id, **kwargs)
# Needs to be executed on all processes for TPU training, but will only save on the processed determined by
# self.args.should_save.
self.save_model()
# Only push from one node.
......
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