@@ -1000,13 +1000,14 @@ def score_model_with_cas(
1000
1000
score_results = se .get_score_execution_results (score_execution , use_cas_gateway )
1001
1001
return score_results
1002
1002
1003
+
1003
1004
def upload_local_model (
1004
- path : Union [str , Path ],
1005
- model_name : str ,
1006
- project_name : str ,
1007
- repo_name : Union [str , dict ] = None ,
1008
- version : str = "latest" ,
1009
- ):
1005
+ path : Union [str , Path ],
1006
+ model_name : str ,
1007
+ project_name : str ,
1008
+ repo_name : Union [str , dict ] = None ,
1009
+ version : str = "latest" ,
1010
+ ):
1010
1011
"""A barebones function to upload a model and any associated files to the model repository.
1011
1012
Parameters
1012
1013
----------
@@ -1043,11 +1044,11 @@ def upload_local_model(
1043
1044
mr .create_project (project_name , repository )
1044
1045
zip_name = str (Path (path ) / (model_name + ".zip" ))
1045
1046
file_names = sorted (Path (path ).glob ("*[!zip]" ))
1046
- with zipfile .ZipFile (
1047
- str (zip_name ), mode = "w"
1048
- ) as zFile :
1049
- for file in file_names :
1050
- zFile .write (str (file ), arcname = file .name )
1047
+ with zipfile .ZipFile (str (zip_name ), mode = "w" ) as zFile :
1048
+ for file in file_names :
1049
+ zFile .write (str (file ), arcname = file .name )
1051
1050
with open (zip_name , "rb" ) as zip_file :
1052
- model = mr .import_model_from_zip (model_name , project_name , zip_file , version = version )
1051
+ model = mr .import_model_from_zip (
1052
+ model_name , project_name , zip_file , version = version
1053
+ )
1053
1054
return model
0 commit comments