|
46 | 46 | upload_local_to_os,
|
47 | 47 | )
|
48 | 48 | from ads.aqua.config.config import evaluation_service_config
|
| 49 | +from ads.aqua.config.evaluation.evaluation_service_config import EvaluationServiceConfig |
49 | 50 | from ads.aqua.constants import (
|
50 | 51 | CONSOLE_LINK_RESOURCE_TYPE_MAPPING,
|
51 | 52 | EVALUATION_REPORT,
|
@@ -171,8 +172,19 @@ def create(
|
171 | 172 | f"Invalid evaluation source {create_aqua_evaluation_details.evaluation_source_id}. "
|
172 | 173 | "Specify either a model or model deployment id."
|
173 | 174 | )
|
| 175 | + |
| 176 | + # The model to evaluate |
174 | 177 | evaluation_source = None
|
| 178 | + # The evaluation service config |
| 179 | + evaluation_config: EvaluationServiceConfig = evaluation_service_config() |
| 180 | + # The evaluation inference configuration. The inference configuration will be extracted |
| 181 | + # based on the inferencing container family. |
175 | 182 | eval_inference_configuration: Dict = {}
|
| 183 | + # The evaluation inference model sampling params. The system parameters that will not be |
| 184 | + # visible for user, but will be applied implicitly for evaluation. The service model params |
| 185 | + # will be extracted based on the container family and version. |
| 186 | + eval_inference_service_model_params: Dict = {} |
| 187 | + |
176 | 188 | if (
|
177 | 189 | DataScienceResource.MODEL_DEPLOYMENT
|
178 | 190 | in create_aqua_evaluation_details.evaluation_source_id
|
@@ -200,9 +212,15 @@ def create(
|
200 | 212 | == runtime.image[: runtime.image.rfind(":")]
|
201 | 213 | ):
|
202 | 214 | eval_inference_configuration = (
|
203 |
| - evaluation_service_config() |
204 |
| - .get_merged_inference_params(inference_container_family) |
205 |
| - .to_dict() |
| 215 | + evaluation_config.get_merged_inference_params( |
| 216 | + inference_container_family |
| 217 | + ).to_dict() |
| 218 | + ) |
| 219 | + eval_inference_service_model_params = ( |
| 220 | + evaluation_config.get_merged_inference_model_params( |
| 221 | + inference_container_family, |
| 222 | + inference_container_info.version, |
| 223 | + ) |
206 | 224 | )
|
207 | 225 |
|
208 | 226 | except Exception:
|
@@ -424,7 +442,10 @@ def create(
|
424 | 442 | container_image=container_image,
|
425 | 443 | dataset_path=evaluation_dataset_path,
|
426 | 444 | report_path=create_aqua_evaluation_details.report_path,
|
427 |
| - model_parameters=create_aqua_evaluation_details.model_parameters, |
| 445 | + model_parameters={ |
| 446 | + **eval_inference_service_model_params, |
| 447 | + **create_aqua_evaluation_details.model_parameters, |
| 448 | + }, |
428 | 449 | metrics=create_aqua_evaluation_details.metrics,
|
429 | 450 | inference_configuration=eval_inference_configuration or {},
|
430 | 451 | )
|
|
0 commit comments