Skip to content

Commit 80c4bb6

Browse files
committed
fix: modify and sort imports
1 parent 835538c commit 80c4bb6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/lightning/pytorch/callbacks/model_checkpoint.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@
3535
from torch import Tensor
3636
from typing_extensions import override
3737

38-
import pytorch_lightning as pl
38+
import lightning.pytorch as pl
39+
from lightning.pytorch.callbacks import Checkpoint
40+
from lightning.pytorch.utilities.exceptions import MisconfigurationException
41+
from lightning.pytorch.utilities.rank_zero import (
42+
WarningCache,
43+
rank_zero_info,
44+
rank_zero_warn,
45+
)
46+
from lightning.pytorch.utilities.types import STEP_OUTPUT
3947
from lightning_fabric.utilities.cloud_io import (
4048
_is_dir,
4149
_is_local_file_protocol,
4250
get_filesystem,
4351
)
4452
from lightning_fabric.utilities.types import _PATH
45-
from pytorch_lightning.callbacks import Checkpoint
46-
from pytorch_lightning.utilities.exceptions import MisconfigurationException
47-
from pytorch_lightning.utilities.rank_zero import (
48-
WarningCache,
49-
rank_zero_info,
50-
rank_zero_warn,
51-
)
52-
from pytorch_lightning.utilities.types import STEP_OUTPUT
5353

5454
log = logging.getLogger(__name__)
5555
warning_cache = WarningCache()
@@ -252,7 +252,7 @@ def __init__(
252252
self.best_k_models: dict[str, dict[str, Tensor | dict[str, Tensor]]] = {}
253253
self.kth_best_model_path = ""
254254
self.best_model_score: Optional[Tensor] = None
255-
self.best_model_metrics: Optional[Dict[str, Tensor]] = None
255+
self.best_model_metrics: Optional[dict[str, Tensor]] = None
256256
self.best_model_path = ""
257257
self.last_model_path = ""
258258
self._last_checkpoint_saved = ""

0 commit comments

Comments
 (0)