Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ba15fe79
Unverified
Commit
ba15fe79
authored
Jul 26, 2021
by
Sylvain Gugger
Committed by
GitHub
Jul 26, 2021
Browse files
Fix push_to_hub for TPUs (#12895)
parent
b3f95dce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/transformers/trainer.py
src/transformers/trainer.py
+4
-3
No files found.
src/transformers/trainer.py
View file @
ba15fe79
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment