Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable running FLAML using the -O flag for the python interpreter #1169

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions flaml/tune/searcher/blendsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,26 @@ def __init__(
sampler = ot.samplers.TPESampler(seed=gs_seed, multivariate=True, group=True)
else:
sampler = None
try:
assert evaluated_rewards
self._gs = GlobalSearch(
space=gs_space,
metric=metric,
mode=mode,
seed=gs_seed,
sampler=sampler,
points_to_evaluate=self._evaluated_points,
evaluated_rewards=evaluated_rewards,
)
except (AssertionError, ValueError):

if evaluated_rewards:
try:
self._gs = GlobalSearch(
space=gs_space,
metric=metric,
mode=mode,
seed=gs_seed,
sampler=sampler,
points_to_evaluate=self._evaluated_points,
evaluated_rewards=evaluated_rewards,
)
except ValueError:
try_without_warmup = True
else:
try_without_warmup = False
else:
try_without_warmup = True

if try_without_warmup:
self._gs = GlobalSearch(
space=gs_space,
metric=metric,
Expand Down
Loading