SaveConfigCallback¶
- class lightning.pytorch.cli.SaveConfigCallback(parser, config, config_filename='config.yaml', overwrite=False, multifile=False)[source]¶
- Bases: - lightning.pytorch.callbacks.callback.Callback- Saves a LightningCLI config to the log_dir when training starts. - Parameters
- parser¶ ( - LightningArgumentParser) – The parser object used to parse the configuration.
- config¶ ( - object) – 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