SaveConfigCallback¶
- class lightning.pytorch.cli.SaveConfigCallback(parser, config, config_filename='config.yaml', overwrite=False, multifile=False)[source]¶
Bases:
Callback
Saves a LightningCLI config to the log_dir when training starts.
- Parameters
parser¶ (
LightningArgumentParser
) – The parser object used to parse the configuration.config¶ (
Namespace
) – The parsed configuration that will be saved.overwrite¶ (
bool
) – Whether to overwrite an existing config file.multifile¶ (
bool
) – When input is multiple config files, saved config preserves this structure.
- Raises
RuntimeError – If the config file already exists in the directory to avoid overwriting a previous run