Skip to content

Commit c46b47d

Browse files
committed
fixed mypy error
1 parent 51da02e commit c46b47d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lightning/pytorch/loggers/mlflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ def after_save_checkpoint(self, checkpoint_callback: ModelCheckpoint) -> None:
331331
# log checkpoints as artifacts
332332
if self._log_model == "all" or self._log_model is True and checkpoint_callback.save_top_k == -1:
333333
self._scan_and_log_checkpoints(checkpoint_callback)
334-
elif self._log_model is True and checkpoint_callback not in self._checkpoint_callbacks:
334+
elif (
335+
self._log_model is True
336+
and self._checkpoint_callbacks
337+
and checkpoint_callback not in self._checkpoint_callbacks
338+
):
335339
self._checkpoint_callbacks.append(checkpoint_callback)
336340

337341
def _scan_and_log_checkpoints(self, checkpoint_callback: ModelCheckpoint) -> None:

0 commit comments

Comments
 (0)