@@ -24,7 +24,7 @@ def write_score_code(
24
24
cls ,
25
25
model_prefix : str ,
26
26
input_data : Union [DataFrame , List [dict ]],
27
- predict_method : [Callable [..., List ], List [Any ]],
27
+ predict_method : Union [Callable [..., List ], List [Any ]],
28
28
target_variable : Optional [str ] = None ,
29
29
target_values : Optional [List ] = None ,
30
30
score_metrics : Optional [List [str ]] = None ,
@@ -515,23 +515,8 @@ def _viya4_model_load(
515
515
pickle_type = pickle_type if pickle_type else "pickle"
516
516
517
517
if mojo_model :
518
- cls .score_code += (
519
- f"with gzip.open(Path(settings.pickle_path) / "
520
- '"{model_file_name}", "r") as fileIn, '
521
- "open(Path(settings.pickle_path) / "
522
- f"\" { str (Path (model_file_name ).with_suffix ('.zip' ))} \" ,"
523
- f" \" wb\" ) as fileOut:\n { '' :4} shutil.copyfileobj(fileIn,"
524
- " fileOut)\n os.chmod(Path(settings.pickle_path) / "
525
- f"\" { str (Path (model_file_name ).with_suffix ('.zip' ))} \" "
526
- ", 0o777)\n model = h2o.import_mojo("
527
- "Path(settings.pickle_path) / "
528
- f"\" { str (Path (model_file_name ).with_suffix ('.zip' ))} \" )"
529
- "\n \n "
530
- )
531
- return (
532
- f"{ '' :8} model = h2o.import_mojo(Path(settings.pickle_path) / "
533
- f"\" { str (Path (model_file_name ).with_suffix ('.zip' ))} \" )\n \n "
534
- )
518
+ cls .score_code += "model = h2o.import_mojo(Path(settings.pickle_path))\n \n "
519
+ return f"{ '' :8} model = h2o.import_mojo(Path(settings.pickle_path))\n \n "
535
520
elif binary_h2o_model :
536
521
cls .score_code += "model = h2o.load(Path(settings.pickle_path))\n \n "
537
522
return f"{ '' :8} model = h2o.load(Path(settings.pickle_path))\n \n "
0 commit comments