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
80e4184f
Unverified
Commit
80e4184f
authored
Jan 28, 2021
by
abhishek thakur
Committed by
GitHub
Jan 28, 2021
Browse files
on_log event should occur *after* the current log is written (#9872)
parent
15e4ce35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/trainer.py
src/transformers/trainer.py
+2
-2
No files found.
src/transformers/trainer.py
View file @
80e4184f
...
...
@@ -680,7 +680,7 @@ class Trainer:
self
,
resume_from_checkpoint
:
Optional
[
str
]
=
None
,
trial
:
Union
[
"optuna.Trial"
,
Dict
[
str
,
Any
]]
=
None
,
**
kwargs
**
kwargs
,
):
"""
Main training entry point.
...
...
@@ -1248,9 +1248,9 @@ class Trainer:
if
self
.
state
.
epoch
is
not
None
:
logs
[
"epoch"
]
=
round
(
self
.
state
.
epoch
,
2
)
self
.
control
=
self
.
callback_handler
.
on_log
(
self
.
args
,
self
.
state
,
self
.
control
,
logs
)
output
=
{
**
logs
,
**
{
"step"
:
self
.
state
.
global_step
}}
self
.
state
.
log_history
.
append
(
output
)
self
.
control
=
self
.
callback_handler
.
on_log
(
self
.
args
,
self
.
state
,
self
.
control
,
logs
)
def
_prepare_inputs
(
self
,
inputs
:
Dict
[
str
,
Union
[
torch
.
Tensor
,
Any
]])
->
Dict
[
str
,
Union
[
torch
.
Tensor
,
Any
]]:
"""
...
...
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