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
bcf02ec7
Unverified
Commit
bcf02ec7
authored
Jun 27, 2023
by
Sourab Mangrulkar
Committed by
GitHub
Jun 27, 2023
Browse files
Update hyperparameter_search.py (#24515)
* Update hyperparameter_search.py * resolve comments
parent
6fe8d198
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/transformers/hyperparameter_search.py
src/transformers/hyperparameter_search.py
+10
-5
No files found.
src/transformers/hyperparameter_search.py
View file @
bcf02ec7
...
@@ -40,7 +40,8 @@ class HyperParamSearchBackendBase:
...
@@ -40,7 +40,8 @@ class HyperParamSearchBackendBase:
name
:
str
name
:
str
pip_package
:
str
=
None
pip_package
:
str
=
None
def
is_available
(
self
):
@
staticmethod
def
is_available
():
raise
NotImplementedError
raise
NotImplementedError
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
...
@@ -63,7 +64,8 @@ class HyperParamSearchBackendBase:
...
@@ -63,7 +64,8 @@ class HyperParamSearchBackendBase:
class
OptunaBackend
(
HyperParamSearchBackendBase
):
class
OptunaBackend
(
HyperParamSearchBackendBase
):
name
=
"optuna"
name
=
"optuna"
def
is_available
(
self
):
@
staticmethod
def
is_available
():
return
is_optuna_available
()
return
is_optuna_available
()
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
...
@@ -77,7 +79,8 @@ class RayTuneBackend(HyperParamSearchBackendBase):
...
@@ -77,7 +79,8 @@ class RayTuneBackend(HyperParamSearchBackendBase):
name
=
"ray"
name
=
"ray"
pip_package
=
"'ray[tune]'"
pip_package
=
"'ray[tune]'"
def
is_available
(
self
):
@
staticmethod
def
is_available
():
return
is_ray_available
()
return
is_ray_available
()
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
...
@@ -90,7 +93,8 @@ class RayTuneBackend(HyperParamSearchBackendBase):
...
@@ -90,7 +93,8 @@ class RayTuneBackend(HyperParamSearchBackendBase):
class
SigOptBackend
(
HyperParamSearchBackendBase
):
class
SigOptBackend
(
HyperParamSearchBackendBase
):
name
=
"sigopt"
name
=
"sigopt"
def
is_available
(
self
):
@
staticmethod
def
is_available
():
return
is_sigopt_available
()
return
is_sigopt_available
()
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
...
@@ -103,7 +107,8 @@ class SigOptBackend(HyperParamSearchBackendBase):
...
@@ -103,7 +107,8 @@ class SigOptBackend(HyperParamSearchBackendBase):
class
WandbBackend
(
HyperParamSearchBackendBase
):
class
WandbBackend
(
HyperParamSearchBackendBase
):
name
=
"wandb"
name
=
"wandb"
def
is_available
(
self
):
@
staticmethod
def
is_available
():
return
is_wandb_available
()
return
is_wandb_available
()
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
def
run
(
self
,
trainer
,
n_trials
:
int
,
direction
:
str
,
**
kwargs
):
...
...
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