mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Fix push_to_hub for TPUs (#12895)
This commit is contained in:
parent
b3f95dceca
commit
ba15fe7995
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user