(args: argparse.Namespace)
| 366 | |
| 367 | @beartype |
| 368 | def dump_config(args: argparse.Namespace) -> None: |
| 369 | config_file = Path(args.result_dir) / "config.json" |
| 370 | if not config_file.exists(): |
| 371 | with open(config_file, "w") as f: |
| 372 | json.dump(vars(args), f, indent=4) |
| 373 | logger.info(f"Dump config to {config_file}") |
| 374 | |
| 375 | |
| 376 | if __name__ == "__main__": |