File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/litmodels/integrations Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import inspect
22import json
3- import os
43import pickle
54import tempfile
65import warnings
109
1110from 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
1514if 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__
You can’t perform that action at this time.
0 commit comments