Skip to content

Commit b053052

Browse files
committed
--unsafe-fixes
1 parent 66b9c7b commit b053052

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/litmodels/integrations/mixins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import warnings
55
from abc import ABC
66
from pathlib import Path
7-
from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union
7+
from typing import TYPE_CHECKING, Any, Optional, Union
88

99
from lightning_utilities.core.rank_zero import rank_zero_warn
1010

@@ -43,7 +43,7 @@ def download_model(
4343

4444
def _setup(
4545
self, name: Optional[str] = None, temp_folder: Union[str, Path, None] = None
46-
) -> Tuple[str, str, Union[str, Path]]:
46+
) -> tuple[str, str, Union[str, Path]]:
4747
"""Parse and validate the model name and temporary folder."""
4848
if name is None:
4949
name = model_name = self.__class__.__name__
@@ -56,7 +56,7 @@ def _setup(
5656
return name, model_name, temp_folder
5757

5858
def _upload_model_files(
59-
self, name: str, path: Union[str, Path, List[Union[str, Path]]], metadata: Optional[dict] = None
59+
self, name: str, path: Union[str, Path, list[Union[str, Path]]], metadata: Optional[dict] = None
6060
) -> None:
6161
"""Upload the model files to the registry."""
6262
if not metadata:

src/litmodels/io/cloud.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# http://www.apache.org/licenses/LICENSE-2.0
44
#
55
from pathlib import Path
6-
from typing import TYPE_CHECKING, Dict, List, Optional, Union
6+
from typing import TYPE_CHECKING, Optional, Union
77

88
from lightning_sdk.lightning_cloud.env import LIGHTNING_CLOUD_URL
99
from lightning_sdk.models import _extend_model_name_with_teamspace, _parse_org_teamspace_model_version
@@ -45,11 +45,11 @@ def _print_model_link(name: str, verbose: Union[bool, int]) -> None:
4545

4646
def upload_model_files(
4747
name: str,
48-
path: Union[str, Path, List[Union[str, Path]]],
48+
path: Union[str, Path, list[Union[str, Path]]],
4949
progress_bar: bool = True,
5050
cloud_account: Optional[str] = None,
5151
verbose: Union[bool, int] = 1,
52-
metadata: Optional[Dict[str, str]] = None,
52+
metadata: Optional[dict[str, str]] = None,
5353
) -> "UploadedModelInfo":
5454
"""Upload a local checkpoint file to the model store.
5555
@@ -83,7 +83,7 @@ def download_model_files(
8383
name: str,
8484
download_dir: Union[str, Path] = ".",
8585
progress_bar: bool = True,
86-
) -> Union[str, List[str]]:
86+
) -> Union[str, list[str]]:
8787
"""Download a checkpoint from the model store.
8888
8989
Args:
@@ -103,7 +103,7 @@ def download_model_files(
103103
)
104104

105105

106-
def _list_available_teamspaces() -> Dict[str, dict]:
106+
def _list_available_teamspaces() -> dict[str, dict]:
107107
"""List available teamspaces for the authenticated user.
108108
109109
Returns:

src/litmodels/io/gateway.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import tempfile
33
from pathlib import Path
4-
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
4+
from typing import TYPE_CHECKING, Any, Optional, Union
55

66
from litmodels.io.cloud import download_model_files, upload_model_files
77
from litmodels.io.utils import _KERAS_AVAILABLE, _PYTORCH_AVAILABLE, dump_pickle, load_pickle
@@ -22,7 +22,7 @@ def upload_model(
2222
progress_bar: bool = True,
2323
cloud_account: Optional[str] = None,
2424
verbose: Union[bool, int] = 1,
25-
metadata: Optional[Dict[str, str]] = None,
25+
metadata: Optional[dict[str, str]] = None,
2626
) -> "UploadedModelInfo":
2727
"""Upload a checkpoint to the model store.
2828
@@ -60,7 +60,7 @@ def save_model(
6060
cloud_account: Optional[str] = None,
6161
staging_dir: Optional[str] = None,
6262
verbose: Union[bool, int] = 1,
63-
metadata: Optional[Dict[str, str]] = None,
63+
metadata: Optional[dict[str, str]] = None,
6464
) -> "UploadedModelInfo":
6565
"""Upload a checkpoint to the model store.
6666
@@ -119,7 +119,7 @@ def download_model(
119119
name: str,
120120
download_dir: Union[str, Path] = ".",
121121
progress_bar: bool = True,
122-
) -> Union[str, List[str]]:
122+
) -> Union[str, list[str]]:
123123
"""Download a checkpoint from the model store.
124124
125125
Args:

0 commit comments

Comments
 (0)