mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-17 12:58:20 +00:00
fix: Changed config registering to not mutate (#119)
This commit is contained in:
+2
-1
@@ -17,7 +17,7 @@ def launch_wandb(project_name:str, default_config:dict, sweep:bool=False):
|
|||||||
|
|
||||||
|
|
||||||
def register_config_with_wandb(wandb: Optional[object], model_config:dict, training_config:dict, data_config:dict):
|
def register_config_with_wandb(wandb: Optional[object], model_config:dict, training_config:dict, data_config:dict):
|
||||||
if wandb is None: return
|
if wandb is None: return model_config, training_config, data_config
|
||||||
|
|
||||||
config: dict = wandb.config
|
config: dict = wandb.config
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ def register_config_with_wandb(wandb: Optional[object], model_config:dict, train
|
|||||||
for k in data_config:
|
for k in data_config:
|
||||||
data_config[k] = config[k]
|
data_config[k] = config[k]
|
||||||
|
|
||||||
|
return model_config, training_config, data_config
|
||||||
|
|
||||||
def send_report_to_wandb(results: pd.DataFrame, wandb:Optional[object], project_name: str, model_name: str):
|
def send_report_to_wandb(results: pd.DataFrame, wandb:Optional[object], project_name: str, model_name: str):
|
||||||
if wandb is None: return
|
if wandb is None: return
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ def __setup_pipeline(project_name:str, with_wandb: bool, sweep: bool):
|
|||||||
wandb = None
|
wandb = None
|
||||||
if with_wandb:
|
if with_wandb:
|
||||||
wandb = launch_wandb(project_name=project_name, default_config=dict(**model_config, **training_config, **data_config), sweep=sweep)
|
wandb = launch_wandb(project_name=project_name, default_config=dict(**model_config, **training_config, **data_config), sweep=sweep)
|
||||||
register_config_with_wandb(wandb, model_config, training_config, data_config)
|
model_config, training_config, data_config = register_config_with_wandb(wandb, model_config, training_config, data_config)
|
||||||
model_config, training_config, data_config = preprocess_config(model_config, training_config, data_config)
|
model_config, training_config, data_config = preprocess_config(model_config, training_config, data_config)
|
||||||
|
|
||||||
return wandb, model_config, training_config, data_config
|
return wandb, model_config, training_config, data_config
|
||||||
|
|||||||
Reference in New Issue
Block a user