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
cf72479b
Commit
cf72479b
authored
Mar 20, 2020
by
Julien Chaumond
Browse files
One last reorder of {scheduler,optimizer}.step()
parent
634bf6cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/contrib/run_openai_gpt.py
examples/contrib/run_openai_gpt.py
+1
-1
No files found.
examples/contrib/run_openai_gpt.py
View file @
cf72479b
...
...
@@ -249,8 +249,8 @@ def main():
losses
=
model
(
input_ids
,
mc_token_ids
=
mc_token_ids
,
lm_labels
=
lm_labels
,
mc_labels
=
mc_labels
)
loss
=
args
.
lm_coef
*
losses
[
0
]
+
losses
[
1
]
loss
.
backward
()
scheduler
.
step
()
optimizer
.
step
()
scheduler
.
step
()
optimizer
.
zero_grad
()
tr_loss
+=
loss
.
item
()
exp_average_loss
=
(
...
...
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