@@ -985,7 +985,14 @@ def get_model_files(os_path: str, model_format: ModelFormat) -> List[str]:
985
985
config_file_name = AQUA_MODEL_ARTIFACT_CONFIG ,
986
986
)
987
987
except Exception as ex :
988
- logger .warning (str (ex ))
988
+ message = (
989
+ f"The model path { os_path } does not contain the file config.json. "
990
+ f"Please check if the path is correct or the model artifacts are available at this location."
991
+ )
992
+ logger .warning (
993
+ f"{ message } \n "
994
+ f"Details: { ex .reason if isinstance (ex , AquaFileNotFoundError ) else str (ex )} \n "
995
+ )
989
996
else :
990
997
model_files .append (AQUA_MODEL_ARTIFACT_CONFIG )
991
998
@@ -1208,17 +1215,21 @@ def _validate_safetensor_format(
1208
1215
config_file_name = AQUA_MODEL_ARTIFACT_CONFIG ,
1209
1216
)
1210
1217
except Exception as ex :
1211
- logger .error (
1212
- f"Exception occurred while loading config file from { import_model_details .os_path } "
1213
- )
1214
- logger .error (
1215
- ex .reason if isinstance (ex , AquaFileNotFoundError ) else str (ex )
1218
+ message = (
1219
+ f"The model path { import_model_details .os_path } does not contain the file config.json. "
1220
+ f"Please check if the path is correct or the model artifacts are available at this location."
1216
1221
)
1217
1222
if not import_model_details .ignore_model_artifact_check :
1218
- raise AquaRuntimeError (
1219
- f"The model path { import_model_details .os_path } does not contain the file config.json. "
1220
- f"Please check if the path is correct or the model artifacts are available at this location."
1221
- ) from ex
1223
+ logger .error (
1224
+ f"{ message } \n "
1225
+ f"Details: { ex .reason if isinstance (ex , AquaFileNotFoundError ) else str (ex )} "
1226
+ )
1227
+ raise AquaRuntimeError (message ) from ex
1228
+ else :
1229
+ logger .warning (
1230
+ f"{ message } \n "
1231
+ f"Proceeding with model registration as ignore_model_artifact_check field is set."
1232
+ )
1222
1233
1223
1234
if verified_model :
1224
1235
# model_type validation, log message if metadata field doesn't match.
@@ -1446,7 +1457,6 @@ def register(
1446
1457
).rstrip ("/" )
1447
1458
else :
1448
1459
artifact_path = import_model_details .os_path .rstrip ("/" )
1449
-
1450
1460
# Create Model catalog entry with pass by reference
1451
1461
ds_model = self ._create_model_catalog_entry (
1452
1462
os_path = artifact_path ,
0 commit comments