mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-03 11:00:57 +08:00
Fix
This commit is contained in:
@@ -250,7 +250,9 @@ def run(times=1, models=None, exclude=False):
|
||||
# run workflow_by_config for multiple times
|
||||
for i in range(times):
|
||||
sys.stderr.write(f"Running the model: {fn} for iteration {i+1}...\n")
|
||||
errs = execute(f"{python_path} {env_path / 'src/pyqlib/qlib/workflow/cli.py'} {yaml_path} {fn}")
|
||||
errs = execute(
|
||||
f"{python_path} {env_path / 'src/pyqlib/qlib/workflow/cli.py'} {yaml_path} {fn} {exp_manager}"
|
||||
)
|
||||
if errs is not None:
|
||||
_errs = errors.get(fn, {})
|
||||
_errs.update({i: errs})
|
||||
|
||||
@@ -103,8 +103,8 @@ class BaseGraph(object):
|
||||
try:
|
||||
# in notebook
|
||||
_ipykernel = str(type(get_ipython()))
|
||||
if 'google.colab' in _ipykernel:
|
||||
renderer = 'colab'
|
||||
if "google.colab" in _ipykernel:
|
||||
renderer = "colab"
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ def sys_config(config, config_path):
|
||||
|
||||
|
||||
# worflow handler function
|
||||
def workflow(config_path, experiment_name="workflow"):
|
||||
def workflow(config_path, experiment_name="workflow", exp_manager=None):
|
||||
with open(config_path) as fp:
|
||||
config = yaml.load(fp, Loader=yaml.Loader)
|
||||
|
||||
@@ -50,7 +50,10 @@ def workflow(config_path, experiment_name="workflow"):
|
||||
|
||||
provider_uri = config.get("provider_uri")
|
||||
region = config.get("region")
|
||||
qlib.init(provider_uri=provider_uri, region=region)
|
||||
if exp_manager:
|
||||
qlib.init(provider_uri=provider_uri, region=region, exp_manager=exp_manager)
|
||||
else:
|
||||
qlib.init(provider_uri=provider_uri, region=region)
|
||||
|
||||
task_train(config, experiment_name=experiment_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user