Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
483a9450
Unverified
Commit
483a9450
authored
Apr 01, 2022
by
Ferdinand Schlatt
Committed by
GitHub
Apr 01, 2022
Browse files
call on_train_end when trial is pruned (#16536)
parent
9de70f21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/transformers/trainer.py
src/transformers/trainer.py
+1
-0
No files found.
src/transformers/trainer.py
View file @
483a9450
...
@@ -991,6 +991,7 @@ class Trainer:
...
@@ -991,6 +991,7 @@ class Trainer:
trial
.
report
(
self
.
objective
,
epoch
)
trial
.
report
(
self
.
objective
,
epoch
)
if
trial
.
should_prune
():
if
trial
.
should_prune
():
self
.
callback_handler
.
on_train_end
(
self
.
args
,
self
.
state
,
self
.
control
)
raise
optuna
.
TrialPruned
()
raise
optuna
.
TrialPruned
()
elif
self
.
hp_search_backend
==
HPSearchBackend
.
RAY
:
elif
self
.
hp_search_backend
==
HPSearchBackend
.
RAY
:
from
ray
import
tune
from
ray
import
tune
...
...
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