Skip to content

Commit bd4205e

Browse files
update logging
1 parent 9cc430b commit bd4205e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

ads/aqua/model/model.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ def get_model_files(os_path: str, model_format: ModelFormat) -> List[str]:
980980
file_path=os_path,
981981
config_file_name=AQUA_MODEL_ARTIFACT_CONFIG,
982982
)
983-
except Exception:
984-
pass
983+
except Exception as ex:
984+
logger.warning(str(ex))
985985
else:
986986
model_files.append(AQUA_MODEL_ARTIFACT_CONFIG)
987987

@@ -1125,8 +1125,11 @@ def _validate_model(
11251125
Tags.LICENSE: license_value,
11261126
}
11271127
validation_result.tags = hf_tags
1128-
except Exception:
1129-
pass
1128+
except Exception as ex:
1129+
logger.debug(
1130+
f"An error occurred while getting tag information for model {model_name}. "
1131+
f"Error: {str(ex)}"
1132+
)
11301133

11311134
validation_result.model_formats = model_formats
11321135

@@ -1235,10 +1238,13 @@ def _validate_safetensor_format(
12351238
f"Could not find {AQUA_MODEL_ARTIFACT_CONFIG_MODEL_TYPE} attribute in "
12361239
f"{AQUA_MODEL_ARTIFACT_CONFIG}. Proceeding with model registration."
12371240
)
1238-
except Exception:
1241+
except Exception as ex:
12391242
# todo: raise exception if model_type doesn't match. Currently log message and pass since service
12401243
# models do not have this metadata.
1241-
pass
1244+
logger.debug(
1245+
f"Error occurred while processing metadata for model {model_name}. "
1246+
f"Exception: {str(ex)}"
1247+
)
12421248
validation_result.telemetry_model_name = verified_model.display_name
12431249
elif (
12441250
model_config is not None

0 commit comments

Comments
 (0)