diff options
Diffstat (limited to 'training')
-rw-r--r-- | training/run.py | 1 | ||||
-rw-r--r-- | training/utils.py | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/training/run.py b/training/run.py index 0cf52e3..ddae2b9 100644 --- a/training/run.py +++ b/training/run.py @@ -67,6 +67,7 @@ def run(config: DictConfig) -> Optional[float]: # Log hyperparameters log.info("Logging hyperparameters") utils.log_hyperparameters(config=config, model=model, trainer=trainer) + utils.save_config(config) if config.debug: log.info("Fast development run...") diff --git a/training/utils.py b/training/utils.py index d23396e..6f57e4d 100644 --- a/training/utils.py +++ b/training/utils.py @@ -17,7 +17,14 @@ from tqdm import tqdm import wandb +def save_config(config: DictConfig) -> None: + """Save config to experiment directory.""" + with open("config.yaml", "w") as f: + OmegaConf.save(config, f=f) + + def print_config(config: DictConfig) -> None: + """Prints config.""" print(OmegaConf.to_yaml(config)) |