Skip to content

Commit dc1d43c

Browse files
Bordarohitgr7
andcommitted
Apply suggestions from code review
Co-authored-by: Rohit Gupta <[email protected]>
1 parent c35ca64 commit dc1d43c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pytorch_lightning/callbacks/model_checkpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ModelCheckpoint(Callback):
8989
mode: one of {min, max}.
9090
If ``save_top_k != 0``, the decision to overwrite the current save file is made
9191
based on either the maximization or the minimization of the monitored quantity.
92-
For `val_acc`, this should be `max`, for `val_loss` this should be `min`, etc.
92+
For ``'val_acc'``, this should be ``'max'``, for ``'val_loss'`` this should be ``'min'``, etc.
9393
save_weights_only: if ``True``, then only the model's weights will be
9494
saved (``model.save_weights(filepath)``), else the full model
9595
is saved (``model.save(filepath)``).
@@ -110,7 +110,7 @@ class ModelCheckpoint(Callback):
110110
MisconfigurationException:
111111
If ``save_top_k`` is neither ``None`` nor more than or equal to ``-1``,
112112
if ``monitor`` is ``None`` and ``save_top_k`` is none of ``None``, ``-1``, and ``0``, or
113-
if ``mode`` is none of ``"min"``, ``"max"``.
113+
if ``mode`` is none of ``"min"`` or ``"max"``.
114114
ValueError:
115115
If ``trainer.save_checkpoint`` is ``None``.
116116

tests/trainer/test_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def test_dp_output_reduce():
421421

422422

423423
@pytest.mark.parametrize(
424-
["save_top_k", "save_last", "expected_files"],
424+
"save_top_k,save_last,expected_files",
425425
[
426426
pytest.param(-1, False, [f"epoch={i}.ckpt" for i in range(5)], id="CASE K=-1 (all)"),
427427
pytest.param(1, False, {"epoch=4.ckpt"}, id="CASE K=1 (2.5, epoch 4)"),

0 commit comments

Comments
 (0)