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
3e4eec47
"vscode:/vscode.git/clone" did not exist on "fd7801c3191e47165c9d2de7a0dd2b299d923f7e"
Unverified
Commit
3e4eec47
authored
Apr 14, 2022
by
Sylvain Gugger
Committed by
GitHub
Apr 14, 2022
Browse files
Kill async pushes when calling push_to_hub with blocking=True (#16755)
parent
c21e1071
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/transformers/trainer.py
src/transformers/trainer.py
+5
-0
No files found.
src/transformers/trainer.py
View file @
3e4eec47
...
@@ -2904,6 +2904,11 @@ class Trainer:
...
@@ -2904,6 +2904,11 @@ class Trainer:
if
not
self
.
is_world_process_zero
():
if
not
self
.
is_world_process_zero
():
return
return
# Cancel any async push in progress if blocking=True. The commits will all be pushed together.
if
blocking
and
self
.
push_in_progress
is
not
None
and
not
self
.
push_in_progress
.
is_done
:
self
.
push_in_progress
.
_process
.
kill
()
self
.
push_in_progress
=
None
git_head_commit_url
=
self
.
repo
.
push_to_hub
(
git_head_commit_url
=
self
.
repo
.
push_to_hub
(
commit_message
=
commit_message
,
blocking
=
blocking
,
auto_lfs_prune
=
True
commit_message
=
commit_message
,
blocking
=
blocking
,
auto_lfs_prune
=
True
)
)
...
...
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