[Enhancement] Do not print config if it is empty (#1028)

This commit is contained in:
Zaida Zhou 2023-03-29 19:54:57 +08:00 committed by GitHub
parent 26a7a92a13
commit b3b1e11b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2290,7 +2290,9 @@ class Runner:
env_info + '\n'
'\nRuntime environment:' + runtime_env_info + '\n' +
dash_line + '\n')
self.logger.info(f'Config:\n{self.cfg.pretty_text}')
if self.cfg._cfg_dict:
self.logger.info(f'Config:\n{self.cfg.pretty_text}')
def _maybe_compile(self, target: str) -> None:
"""Use `torch.compile` to optimize model/wrapped_model."""