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
8f2c07d3
Unverified
Commit
8f2c07d3
authored
Oct 06, 2021
by
Sylvain Gugger
Committed by
GitHub
Oct 06, 2021
Browse files
Fix hp search for non sigopt backends (#13897)
parent
77770ec7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/transformers/trainer.py
src/transformers/trainer.py
+5
-1
No files found.
src/transformers/trainer.py
View file @
8f2c07d3
...
@@ -1238,7 +1238,11 @@ class Trainer:
...
@@ -1238,7 +1238,11 @@ class Trainer:
self
.
callback_handler
.
lr_scheduler
=
self
.
lr_scheduler
self
.
callback_handler
.
lr_scheduler
=
self
.
lr_scheduler
self
.
callback_handler
.
train_dataloader
=
train_dataloader
self
.
callback_handler
.
train_dataloader
=
train_dataloader
self
.
state
.
trial_name
=
self
.
hp_name
(
trial
)
if
self
.
hp_name
is
not
None
else
None
self
.
state
.
trial_name
=
self
.
hp_name
(
trial
)
if
self
.
hp_name
is
not
None
else
None
self
.
state
.
trial_params
=
hp_params
(
trial
.
assignments
)
if
trial
is
not
None
else
None
if
trial
is
not
None
:
assignments
=
trial
.
assignments
if
self
.
hp_search_backend
==
HPSearchBackend
.
SIGOPT
else
trial
self
.
state
.
trial_params
=
hp_params
(
assignments
)
else
:
self
.
state
.
trial_params
=
None
# This should be the same if the state has been saved but in case the training arguments changed, it's safer
# This should be the same if the state has been saved but in case the training arguments changed, it's safer
# to set this after the load.
# to set this after the load.
self
.
state
.
max_steps
=
max_steps
self
.
state
.
max_steps
=
max_steps
...
...
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