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
94e17c45
Unverified
Commit
94e17c45
authored
Nov 04, 2022
by
Sanchit Gandhi
Committed by
GitHub
Nov 04, 2022
Browse files
[Trainer] Fix model name in push_to_hub (#20064)
parent
19067711
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/trainer.py
src/transformers/trainer.py
+2
-1
No files found.
src/transformers/trainer.py
View file @
94e17c45
...
@@ -3444,7 +3444,8 @@ class Trainer:
...
@@ -3444,7 +3444,8 @@ class Trainer:
if
not
hasattr
(
self
,
"repo"
):
if
not
hasattr
(
self
,
"repo"
):
self
.
init_git_repo
()
self
.
init_git_repo
()
if
self
.
args
.
should_save
:
model_name
=
kwargs
.
pop
(
"model_name"
,
None
)
if
model_name
is
None
and
self
.
args
.
should_save
:
if
self
.
args
.
hub_model_id
is
None
:
if
self
.
args
.
hub_model_id
is
None
:
model_name
=
Path
(
self
.
args
.
output_dir
).
name
model_name
=
Path
(
self
.
args
.
output_dir
).
name
else
:
else
:
...
...
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