File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/autogluon/cloud/scripts/sagemaker_scripts Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1616from autogluon .tabular import TabularPredictor
1717
1818image_dir = os .path .join ("/tmp" , "ag_images" )
19+ logging .basicConfig (stream = sys .stdout , level = logging .INFO )
20+ logger = logging .getLogger (__name__ )
1921
2022
2123def _save_image_and_update_dataframe_column (bytes ):
@@ -34,9 +36,14 @@ def _save_image_and_update_dataframe_column(bytes):
3436
3537def model_fn (model_dir ):
3638 """loads model from previously saved artifact"""
37- model = TabularPredictor .load (model_dir )
38- model .persist_models ()
39- globals ()["column_names" ] = model .original_features
39+ logger .info ("Loading the model" )
40+ try :
41+ model = TabularPredictor .load (model_dir )
42+ model .persist_models ()
43+ globals ()["column_names" ] = model .original_features
44+ except Exception as e :
45+ logger .error (f"Error loading the model: { str (e )} " )
46+ raise e
4047
4148 return model
4249
You can’t perform that action at this time.
0 commit comments