log_file_name in tune.run() (#681)

* log_file_name in tune.run()

* use_ray validates log_file_name

* assert no ray_args when not use_ray

* import os and use os.path
This commit is contained in:
Chi Wang
2022-08-15 06:15:31 -07:00
committed by GitHub
parent 5e1059ab82
commit d60d38b3e9
4 changed files with 26 additions and 16 deletions

View File

@@ -22,6 +22,7 @@ def test_config_constraint():
metric="metric",
mode="max",
num_samples=100,
log_file_name="logs/config_constraint.log",
)
assert analysis.best_config["x"] > analysis.best_config["y"]

View File

@@ -295,7 +295,7 @@ def test_searcher():
print(searcher.suggest("t1"))
from flaml import tune
tune.run(lambda x: 1, config={}, use_ray=use_ray)
tune.run(lambda x: 1, config={}, use_ray=use_ray, log_file_name="logs/searcher.log")
def test_no_optuna():

View File

@@ -47,6 +47,8 @@ def test_nested_run():
mode="min",
num_samples=5,
local_dir="logs",
log_file_name="logs/nested.log",
verbose=3,
)
print(analysis.best_result)