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
7b4b0cf9
Commit
7b4b0cf9
authored
Feb 08, 2019
by
thomwolf
Browse files
logging
parent
4bbb9f2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/run_openai_gpt.py
examples/run_openai_gpt.py
+1
-1
No files found.
examples/run_openai_gpt.py
View file @
7b4b0cf9
...
@@ -202,7 +202,7 @@ def main():
...
@@ -202,7 +202,7 @@ def main():
tr_loss
+=
loss
.
item
()
tr_loss
+=
loss
.
item
()
nb_tr_examples
+=
input_ids
.
size
(
0
)
nb_tr_examples
+=
input_ids
.
size
(
0
)
nb_tr_steps
+=
1
nb_tr_steps
+=
1
tqdm_bar
.
desc
=
"Training loss: {:
e
.2}"
.
format
(
tr_loss
/
nb_tr_steps
)
tqdm_bar
.
desc
=
"Training loss: {:.2
e
}"
.
format
(
tr_loss
/
nb_tr_steps
)
# Save a trained model
# Save a trained model
model_to_save
=
model
.
module
if
hasattr
(
model
,
'module'
)
else
model
# Only save the model it-self
model_to_save
=
model
.
module
if
hasattr
(
model
,
'module'
)
else
model
# Only save the model it-self
...
...
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