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
6af5a54c
Commit
6af5a54c
authored
Apr 23, 2020
by
Julien Chaumond
Browse files
[Trainer] reuse constant
parent
7c2a32ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/trainer.py
src/transformers/trainer.py
+1
-1
No files found.
src/transformers/trainer.py
View file @
6af5a54c
...
@@ -358,7 +358,7 @@ class Trainer:
...
@@ -358,7 +358,7 @@ class Trainer:
else
:
else
:
assert
model
is
self
.
model
assert
model
is
self
.
model
# Save model checkpoint
# Save model checkpoint
output_dir
=
os
.
path
.
join
(
self
.
args
.
output_dir
,
f
"
checkpoint
-
{
global_step
}
"
)
output_dir
=
os
.
path
.
join
(
self
.
args
.
output_dir
,
f
"
{
PREFIX_CHECKPOINT_DIR
}
-
{
global_step
}
"
)
self
.
save_model
(
output_dir
)
self
.
save_model
(
output_dir
)
self
.
_rotate_checkpoints
()
self
.
_rotate_checkpoints
()
torch
.
save
(
optimizer
.
state_dict
(),
os
.
path
.
join
(
output_dir
,
"optimizer.pt"
))
torch
.
save
(
optimizer
.
state_dict
(),
os
.
path
.
join
(
output_dir
,
"optimizer.pt"
))
...
...
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