77import re
88import tempfile
99from concurrent .futures import ThreadPoolExecutor , as_completed
10- from dataclasses import asdict
10+ from dataclasses import asdict , fields
1111from datetime import datetime , timedelta
1212from pathlib import Path
1313from threading import Lock
@@ -160,8 +160,9 @@ def create(
160160 create_aqua_evaluation_details = CreateAquaEvaluationDetails (** kwargs )
161161 except Exception as ex :
162162 raise AquaValueError (
163- "Invalid create evaluation parameters. Allowable parameters are: "
164- f"{ ', ' .join (list (asdict (CreateAquaEvaluationDetails ).keys ()))} ."
163+ "Invalid create evaluation parameters. "
164+ "Allowable parameters are: "
165+ f"{ ', ' .join ([field .name for field in fields (CreateAquaEvaluationDetails )])} ."
165166 ) from ex
166167
167168 if not is_valid_ocid (create_aqua_evaluation_details .evaluation_source_id ):
@@ -178,18 +179,28 @@ def create(
178179 evaluation_source = ModelDeployment .from_id (
179180 create_aqua_evaluation_details .evaluation_source_id
180181 )
181- if evaluation_source .runtime .type == ModelDeploymentRuntimeType .CONTAINER :
182- runtime = ModelDeploymentContainerRuntime .from_dict (
183- evaluation_source .runtime .to_dict ()
182+ try :
183+ if (
184+ evaluation_source .runtime .type
185+ == ModelDeploymentRuntimeType .CONTAINER
186+ ):
187+ runtime = ModelDeploymentContainerRuntime .from_dict (
188+ evaluation_source .runtime .to_dict ()
189+ )
190+ inference_config = AquaContainerConfig .from_container_index_json (
191+ enable_spec = True
192+ ).inference
193+ for container in inference_config .values ():
194+ if container .name == runtime .image .split (":" )[0 ]:
195+ eval_inference_configuration = (
196+ container .spec .evaluation_configuration
197+ )
198+ except Exception :
199+ logger .debug (
200+ f"Could not load inference config details for the evaluation id: "
201+ f"{ create_aqua_evaluation_details .evaluation_source_id } . Please check if the container"
202+ f" runtime has the correct SMC image information."
184203 )
185- inference_config = AquaContainerConfig .from_container_index_json (
186- enable_spec = True
187- ).inference
188- for container in inference_config .values ():
189- if container .name == runtime .image .split (":" )[0 ]:
190- eval_inference_configuration = (
191- container .spec .evaluation_configuration
192- )
193204 elif (
194205 DataScienceResource .MODEL
195206 in create_aqua_evaluation_details .evaluation_source_id
@@ -550,7 +561,7 @@ def _build_evaluation_runtime(
550561 metrics = metrics ,
551562 ),
552563 ),
553- ** inference_configuration ,
564+ ** ( inference_configuration or {}) ,
554565 },
555566 ),
556567 "CONDA_BUCKET_NS" : CONDA_BUCKET_NS ,
0 commit comments