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
85395e49
"tests/models/vscode:/vscode.git/clone" did not exist on "893ab12452f50f303fcbfe2539e79d05ed8597b3"
Unverified
Commit
85395e49
authored
Feb 09, 2021
by
Shiva Zamani
Committed by
GitHub
Feb 09, 2021
Browse files
Remove speed metrics from default compute objective (#10107)
parent
7c7962ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/trainer_utils.py
src/transformers/trainer_utils.py
+4
-0
No files found.
src/transformers/trainer_utils.py
View file @
85395e49
...
...
@@ -131,6 +131,10 @@ def default_compute_objective(metrics: Dict[str, float]) -> float:
metrics
=
copy
.
deepcopy
(
metrics
)
loss
=
metrics
.
pop
(
"eval_loss"
,
None
)
_
=
metrics
.
pop
(
"epoch"
,
None
)
# Remove speed metrics
speed_metrics
=
[
m
for
m
in
metrics
.
keys
()
if
m
.
endswith
(
"_runtime"
)
or
m
.
endswith
(
"_samples_per_second"
)]
for
sm
in
speed_metrics
:
_
=
metrics
.
pop
(
sm
,
None
)
return
loss
if
len
(
metrics
)
==
0
else
sum
(
metrics
.
values
())
...
...
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