diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-24 00:58:54 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-24 00:58:54 +0200 |
commit | 45dfa045d929c0b3a3f905f9c0723fe8dc809bc6 (patch) | |
tree | be04d85268c7884f6e5f074b85db3bd972dbe7d5 /training/utils.py | |
parent | bdc85d2417a12e2978957156076eaaeff7e28999 (diff) |
Format training utils
Diffstat (limited to 'training/utils.py')
-rw-r--r-- | training/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/training/utils.py b/training/utils.py index 41e0a71..1996f0a 100644 --- a/training/utils.py +++ b/training/utils.py @@ -38,6 +38,7 @@ def configure_logging(config: DictConfig) -> None: def configure_callbacks(config: DictConfig,) -> List[Type[Callback]]: """Configures Lightning callbacks.""" + def load_callback(callback_config: DictConfig) -> Type[Callback]: log.info(f"Instantiating callback <{callback_config._target_}>") return hydra.utils.instantiate(callback_config) @@ -47,7 +48,7 @@ def configure_callbacks(config: DictConfig,) -> List[Type[Callback]]: for callback_config in callback_configs.values(): if callback_config.get("_target_"): callbacks.append(load_callback(callback_config)) - else: + else: callbacks += load_callbacks(callback_config) return callbacks @@ -58,6 +59,7 @@ def configure_callbacks(config: DictConfig,) -> List[Type[Callback]]: def configure_logger(config: DictConfig) -> List[Type[LightningLoggerBase]]: """Configures Lightning loggers.""" + def load_logger(logger_config: DictConfig) -> Type[LightningLoggerBase]: log.info(f"Instantiating logger <{logger_config._target_}>") return hydra.utils.instantiate(logger_config) |