@@ -232,6 +232,12 @@ def get(self, model_id: str, load_model_card: Optional[bool] = True) -> "AquaMod
232
232
ModelCustomMetadataFields .DEPLOYMENT_CONTAINER ,
233
233
ModelCustomMetadataItem (key = ModelCustomMetadataFields .DEPLOYMENT_CONTAINER ),
234
234
).value
235
+ inference_container_uri = ds_model .custom_metadata_list .get (
236
+ ModelCustomMetadataFields .DEPLOYMENT_CONTAINER_URI ,
237
+ ModelCustomMetadataItem (
238
+ key = ModelCustomMetadataFields .DEPLOYMENT_CONTAINER_URI
239
+ ),
240
+ ).value
235
241
evaluation_container = ds_model .custom_metadata_list .get (
236
242
ModelCustomMetadataFields .EVALUATION_CONTAINER ,
237
243
ModelCustomMetadataItem (key = ModelCustomMetadataFields .EVALUATION_CONTAINER ),
@@ -250,6 +256,7 @@ def get(self, model_id: str, load_model_card: Optional[bool] = True) -> "AquaMod
250
256
project_id = ds_model .project_id ,
251
257
model_card = model_card ,
252
258
inference_container = inference_container ,
259
+ inference_container_uri = inference_container_uri ,
253
260
finetuning_container = finetuning_container ,
254
261
evaluation_container = evaluation_container ,
255
262
artifact_location = artifact_location ,
@@ -696,23 +703,26 @@ def _create_model_catalog_entry(
696
703
description = f"Inference container mapping for { model_name } " ,
697
704
category = "Other" ,
698
705
)
706
+ if inference_container_uri :
707
+ metadata .add (
708
+ key = AQUA_DEPLOYMENT_CONTAINER_URI_METADATA_NAME ,
709
+ value = inference_container_uri ,
710
+ description = f"Inference container URI for { model_name } " ,
711
+ category = "Other" ,
712
+ )
713
+
714
+ inference_containers = (
715
+ AquaContainerConfig .from_container_index_json ().inference
716
+ )
717
+ smc_container_set = {
718
+ container .family for container in inference_containers .values ()
719
+ }
720
+ # only add cmd vars if inference container is not an SMC
699
721
if (
700
- inference_container
722
+ inference_container not in smc_container_set
723
+ and inference_container
701
724
== InferenceContainerTypeFamily .AQUA_TEI_CONTAINER_FAMILY
702
725
):
703
- if not inference_container_uri :
704
- logger .warn (
705
- f"Proceeding with model registration without the inference container URI for "
706
- f"{ inference_container } . You can still add this configuration during model deployment."
707
- )
708
- else :
709
- metadata .add (
710
- key = AQUA_DEPLOYMENT_CONTAINER_URI_METADATA_NAME ,
711
- value = inference_container_uri ,
712
- description = f"Inference container URI for { model_name } " ,
713
- category = "Other" ,
714
- )
715
-
716
726
cmd_vars = generate_tei_cmd_var (os_path )
717
727
metadata .add (
718
728
key = AQUA_DEPLOYMENT_CONTAINER_CMD_VAR_METADATA_NAME ,
@@ -1231,20 +1241,23 @@ def register(
1231
1241
# registered model will always have inference and evaluation container, but
1232
1242
# fine-tuning container may be not set
1233
1243
inference_container = ds_model .custom_metadata_list .get (
1234
- ModelCustomMetadataFields .DEPLOYMENT_CONTAINER
1244
+ ModelCustomMetadataFields .DEPLOYMENT_CONTAINER ,
1245
+ ModelCustomMetadataItem (key = ModelCustomMetadataFields .DEPLOYMENT_CONTAINER ),
1246
+ ).value
1247
+ inference_container_uri = ds_model .custom_metadata_list .get (
1248
+ ModelCustomMetadataFields .DEPLOYMENT_CONTAINER_URI ,
1249
+ ModelCustomMetadataItem (
1250
+ key = ModelCustomMetadataFields .DEPLOYMENT_CONTAINER_URI
1251
+ ),
1252
+ ).value
1253
+ evaluation_container = ds_model .custom_metadata_list .get (
1254
+ ModelCustomMetadataFields .EVALUATION_CONTAINER ,
1255
+ ModelCustomMetadataItem (key = ModelCustomMetadataFields .EVALUATION_CONTAINER ),
1256
+ ).value
1257
+ finetuning_container : str = ds_model .custom_metadata_list .get (
1258
+ ModelCustomMetadataFields .FINETUNE_CONTAINER ,
1259
+ ModelCustomMetadataItem (key = ModelCustomMetadataFields .FINETUNE_CONTAINER ),
1235
1260
).value
1236
- try :
1237
- evaluation_container = ds_model .custom_metadata_list .get (
1238
- ModelCustomMetadataFields .EVALUATION_CONTAINER ,
1239
- ).value
1240
- except Exception :
1241
- evaluation_container = None
1242
- try :
1243
- finetuning_container = ds_model .custom_metadata_list .get (
1244
- ModelCustomMetadataFields .FINETUNE_CONTAINER ,
1245
- ).value
1246
- except Exception :
1247
- finetuning_container = None
1248
1261
1249
1262
aqua_model_attributes = dict (
1250
1263
** self ._process_model (ds_model , self .region ),
@@ -1256,6 +1269,7 @@ def register(
1256
1269
)
1257
1270
),
1258
1271
inference_container = inference_container ,
1272
+ inference_container_uri = inference_container_uri ,
1259
1273
finetuning_container = finetuning_container ,
1260
1274
evaluation_container = evaluation_container ,
1261
1275
artifact_location = artifact_path ,
0 commit comments