@@ -1000,13 +1000,14 @@ def score_model_with_cas(
10001000 score_results = se .get_score_execution_results (score_execution , use_cas_gateway )
10011001 return score_results
10021002
1003+
10031004def 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+ ):
10101011 """A barebones function to upload a model and any associated files to the model repository.
10111012 Parameters
10121013 ----------
@@ -1043,11 +1044,11 @@ def upload_local_model(
10431044 mr .create_project (project_name , repository )
10441045 zip_name = str (Path (path ) / (model_name + ".zip" ))
10451046 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 )
10511050 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+ )
10531054 return model
0 commit comments