Skip to content

Commit 063caed

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 88293e8 commit 063caed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/litmodels/integrations/mixins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import inspect
22
import json
3-
import os
43
import pickle
54
import tempfile
65
import warnings
@@ -10,7 +9,7 @@
109

1110
from lightning_utilities.core.rank_zero import rank_zero_warn
1211

13-
from litmodels.io.cloud import upload_model_files, download_model_files
12+
from litmodels.io.cloud import download_model_files, upload_model_files
1413

1514
if TYPE_CHECKING:
1615
import torch
@@ -132,6 +131,7 @@ def push_to_registry(
132131
temp_folder: The temporary folder to save the model. If None, a default temporary folder is used.
133132
"""
134133
import torch
134+
135135
# Ensure that the model is in evaluation mode
136136
if not isinstance(self, torch.nn.Module):
137137
raise TypeError(f"The model must be a PyTorch `nn.Module` but got: {type(self)}")
@@ -203,7 +203,7 @@ def pull_from_registry(
203203
raise RuntimeError(f"Multiple init files found for model: {model_registry} with {init_files}")
204204
else:
205205
init_kwargs_path = Path(temp_folder) / init_files[0]
206-
with open(init_kwargs_path, "r") as fp:
206+
with open(init_kwargs_path) as fp:
207207
init_kwargs = json.load(fp)
208208

209209
# Create a new model instance without calling __init__

0 commit comments

Comments
 (0)