Skip to content

Commit 048ad86

Browse files
committed
change default prefix from empty string to Optinal to better convey meaning of unused empty variable in function signutare
1 parent f2cd64f commit 048ad86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lightning/pytorch/callbacks/model_checkpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def _format_checkpoint_name(
563563
self,
564564
filename: Optional[str],
565565
metrics: dict[str, Tensor],
566-
prefix: str = "",
566+
prefix: Optional[str] = None,
567567
auto_insert_metric_name: bool = True,
568568
) -> str:
569569
if not filename:
@@ -590,7 +590,7 @@ def _format_checkpoint_name(
590590
metrics[name] = torch.tensor(0)
591591
filename = filename.format(metrics)
592592

593-
if prefix:
593+
if prefix is not None:
594594
filename = self.CHECKPOINT_JOIN_CHAR.join([prefix, filename])
595595

596596
return filename

0 commit comments

Comments
 (0)