Skip to content

Commit b160ce9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3c43e14 commit b160ce9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/litmodels/integrations/checkpoints.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Type, TypeVar, cast
1+
from typing import Any, TypeVar
22

33
from lightning_sdk.lightning_cloud.login import Auth
44
from lightning_utilities.core.rank_zero import rank_zero_only
@@ -38,6 +38,7 @@ def _upload_model(self, filepath: str) -> None:
3838

3939
# Create specific implementations
4040
if _LIGHTNING_AVAILABLE:
41+
4142
class LightningModelCheckpoint(LitModelCheckpointMixin, _LightningModelCheckpoint):
4243
"""Lightning ModelCheckpoint with LitModel support.
4344
@@ -55,7 +56,9 @@ def _save_checkpoint(self, trainer: "Trainer", filepath: str) -> None:
5556
super()._save_checkpoint(trainer, filepath)
5657
self._upload_model(filepath)
5758

59+
5860
if _PYTORCHLIGHTNING_AVAILABLE:
61+
5962
class PTLightningModelCheckpoint(LitModelCheckpointMixin, _PytorchLightningModelCheckpoint):
6063
"""PyTorch Lightning ModelCheckpoint with LitModel support.
6164
@@ -71,4 +74,4 @@ def __init__(self, model_name: str, *args: Any, **kwargs: Any) -> None:
7174

7275
def _save_checkpoint(self, trainer: "Trainer", filepath: str) -> None:
7376
super()._save_checkpoint(trainer, filepath)
74-
self._upload_model(filepath)
77+
self._upload_model(filepath)

0 commit comments

Comments
 (0)