Skip to content

Commit

Permalink
[CLI] Save only the configuration used (#11532)
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca authored and rohitgr7 committed Feb 7, 2022
1 parent 56ca03d commit 2cb9fa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Fixed

-
- Fixed the format of the configuration saved automatically by the CLI's `SaveConfigCallback` ([#11532](https://github.com/PyTorchLightning/pytorch-lightning/pull/11532))


-

Expand Down
4 changes: 4 additions & 0 deletions tests/utilities/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,10 @@ def test_lightning_cli_config_before_subcommand():
validate_mock.assert_called_once_with(cli.trainer, cli.model, verbose=False, ckpt_path="barfoo")
assert cli.trainer.limit_val_batches == 1

save_config_callback = cli.trainer.callbacks[0]
assert save_config_callback.config["trainer"]["limit_val_batches"] == 1
assert save_config_callback.parser.subcommand == "validate"


@RunIf(min_python="3.7.3")
def test_lightning_cli_config_before_subcommand_two_configs():
Expand Down

0 comments on commit 2cb9fa9

Please sign in to comment.