File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
ads/opctl/operator/lowcode/forecast/whatifserve Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11
11
import oci
12
12
13
13
import pandas as pd
14
- from joblib import dump
14
+ import cloudpickle
15
15
16
16
from ads .opctl import logger
17
17
from ads .common .model_export_util import prepare_generic_model
@@ -93,7 +93,8 @@ def save_to_catalog(self):
93
93
os .mkdir (self .path_to_artifact )
94
94
95
95
artifact_dict = {"spec" : self .spec .to_dict (), "models" : self .model_obj }
96
- dump (artifact_dict , os .path .join (self .path_to_artifact , "model.joblib" ))
96
+ with open (f"{ self .path_to_artifact } /models.pickle" , "wb" ) as f :
97
+ cloudpickle .dump (artifact_dict , f )
97
98
artifact = prepare_generic_model (
98
99
self .path_to_artifact ,
99
100
function_artifacts = False ,
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def load_model():
44
44
"""
45
45
model_dir = os .path .dirname (os .path .realpath (__file__ ))
46
46
contents = os .listdir (model_dir )
47
- model_file_name = "model.joblib "
47
+ model_file_name = "models.pickle "
48
48
if model_file_name in contents :
49
49
with open (os .path .join (os .path .dirname (os .path .realpath (__file__ )), model_file_name ), "rb" ) as file :
50
50
model = load (file )
You can’t perform that action at this time.
0 commit comments