@@ -1070,9 +1070,9 @@ def create_defined_metadata_artifact(
1070
1070
metadata_key : str ,
1071
1071
path_type : MetadataArtifactPathType ,
1072
1072
artifact_path_or_content : str ,
1073
- ):
1073
+ ) -> None :
1074
1074
"""
1075
- Creates defined metadata artifact for the given model
1075
+ Creates defined metadata artifact for the registered unverified model
1076
1076
1077
1077
Args:
1078
1078
model_id: str
@@ -1084,22 +1084,13 @@ def create_defined_metadata_artifact(
1084
1084
artifact_path_or_content: str
1085
1085
It can be local path or oss path or the actual content itself
1086
1086
Returns:
1087
- The model defined metadata artifact creation info.
1088
- Example:
1089
- {
1090
- 'Date': 'Mon, 02 Dec 2024 06:38:24 GMT',
1091
- 'opc-request-id': 'E4F7',
1092
- 'ETag': '77156317-8bb9-4c4a-882b-0d85f8140d93',
1093
- 'X-Content-Type-Options': 'nosniff',
1094
- 'Content-Length': '4029958',
1095
- 'Vary': 'Origin',
1096
- 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
1097
- 'status': 204
1098
- }
1099
-
1087
+ None
1100
1088
"""
1101
1089
1102
1090
ds_model = DataScienceModel .from_id (model_id )
1091
+ oci_aqua = ds_model .freeform_tags .get (Tags .AQUA_TAG , None )
1092
+ if not oci_aqua :
1093
+ raise AquaRuntimeError (f"Target model { model_id } is not an Aqua model." )
1103
1094
is_registered_model = ds_model .freeform_tags .get (Tags .BASE_MODEL_CUSTOM , None )
1104
1095
is_verified_model = ds_model .freeform_tags .get (
1105
1096
Tags .AQUA_SERVICE_MODEL_TAG , None
@@ -1113,11 +1104,11 @@ def create_defined_metadata_artifact(
1113
1104
)
1114
1105
except Exception as ex :
1115
1106
raise AquaRuntimeError (
1116
- f"Error occurred in creating defined metadata artifact for model: { model_id } : { ex } "
1107
+ f"Error occurred in creating defined metadata artifact for model { model_id } : { ex } "
1117
1108
) from ex
1118
1109
else :
1119
1110
raise AquaRuntimeError (
1120
- f"Cannot create defined metadata artifact for model: { model_id } "
1111
+ f"Cannot create defined metadata artifact for model { model_id } "
1121
1112
)
1122
1113
1123
1114
def _create_model_catalog_entry (
0 commit comments