|
38 | 38 | JOB_INFRASTRUCTURE_TYPE_DEFAULT_NETWORKING, |
39 | 39 | NB_SESSION_IDENTIFIER, |
40 | 40 | UNKNOWN, |
| 41 | + extract_id_and_name_from_tag, |
41 | 42 | fire_and_forget, |
42 | 43 | get_container_image, |
43 | 44 | is_valid_ocid, |
@@ -694,7 +695,7 @@ def create( |
694 | 695 | self.telemetry.record_event_async( |
695 | 696 | category="aqua/evaluation", |
696 | 697 | action="create", |
697 | | - detail=evaluation_source.display_name, |
| 698 | + detail=self._get_service_model_name(evaluation_source), |
698 | 699 | ) |
699 | 700 |
|
700 | 701 | return AquaEvaluationSummary( |
@@ -784,6 +785,34 @@ def _build_evaluation_runtime( |
784 | 785 | ) |
785 | 786 |
|
786 | 787 | return runtime |
| 788 | + |
| 789 | + @staticmethod |
| 790 | + def _get_service_model_name( |
| 791 | + source: Union[ModelDeployment, DataScienceModel] |
| 792 | + ) -> str: |
| 793 | + """Gets the service model name from source. If it's ModelDeployment, needs to check |
| 794 | + if its model has been fine tuned or not. |
| 795 | +
|
| 796 | + Parameters |
| 797 | + ---------- |
| 798 | + source: Union[ModelDeployment, DataScienceModel] |
| 799 | + An instance of either ModelDeployment or DataScienceModel |
| 800 | +
|
| 801 | + Returns |
| 802 | + ------- |
| 803 | + str: |
| 804 | + The service model name of source. |
| 805 | + """ |
| 806 | + if isinstance(source, ModelDeployment): |
| 807 | + fine_tuned_model_tag = source.freeform_tags.get( |
| 808 | + Tags.AQUA_FINE_TUNED_MODEL_TAG.value, UNKNOWN |
| 809 | + ) |
| 810 | + if not fine_tuned_model_tag: |
| 811 | + return source.freeform_tags.get(Tags.AQUA_MODEL_NAME_TAG.value) |
| 812 | + else: |
| 813 | + return extract_id_and_name_from_tag(fine_tuned_model_tag)[1] |
| 814 | + |
| 815 | + return source.display_name |
787 | 816 |
|
788 | 817 | @staticmethod |
789 | 818 | def _get_evaluation_container(source_id: str) -> str: |
@@ -983,7 +1012,7 @@ def list( |
983 | 1012 | self._process_evaluation_summary(model=model, jobrun=jobrun) |
984 | 1013 | ) |
985 | 1014 | except Exception as exc: |
986 | | - logger.error( |
| 1015 | + logger.debug( |
987 | 1016 | f"Processing evaluation: {model.identifier} generated an exception: {exc}" |
988 | 1017 | ) |
989 | 1018 | evaluations.append( |
@@ -1028,7 +1057,7 @@ def _if_eval_artifact_exist( |
1028 | 1057 | return True if response.status == 200 else False |
1029 | 1058 | except oci.exceptions.ServiceError as ex: |
1030 | 1059 | if ex.status == 404: |
1031 | | - logger.info("Evaluation artifact not found.") |
| 1060 | + logger.debug(f"Evaluation artifact not found for {model.identifier}.") |
1032 | 1061 | return False |
1033 | 1062 |
|
1034 | 1063 | @telemetry(entry_point="plugin=evaluation&action=get_status", name="aqua") |
@@ -1574,8 +1603,9 @@ def _build_resource_identifier( |
1574 | 1603 | ), |
1575 | 1604 | ) |
1576 | 1605 | except Exception as e: |
1577 | | - logger.error( |
1578 | | - f"Failed to construct AquaResourceIdentifier from given id=`{id}`, and name=`{name}`, {str(e)}" |
| 1606 | + logger.debug( |
| 1607 | + f"Failed to construct AquaResourceIdentifier from given id=`{id}`, and name=`{name}`. " |
| 1608 | + f"DEBUG INFO: {str(e)}" |
1579 | 1609 | ) |
1580 | 1610 | return AquaResourceIdentifier() |
1581 | 1611 |
|
@@ -1621,7 +1651,7 @@ def _fetch_runtime_params( |
1621 | 1651 | ) |
1622 | 1652 | if not params.get(EvaluationConfig.PARAMS): |
1623 | 1653 | raise AquaMissingKeyError( |
1624 | | - "model parameters have not been saved in correct format in model taxonomy.", |
| 1654 | + "model parameters have not been saved in correct format in model taxonomy. ", |
1625 | 1655 | service_payload={"params": params}, |
1626 | 1656 | ) |
1627 | 1657 | # TODO: validate the format of parameters. |
@@ -1653,7 +1683,7 @@ def _build_job_identifier( |
1653 | 1683 |
|
1654 | 1684 | except Exception as e: |
1655 | 1685 | logger.debug( |
1656 | | - f"Failed to get job details from job_run_details: {job_run_details}" |
| 1686 | + f"Failed to get job details from job_run_details: {job_run_details} " |
1657 | 1687 | f"DEBUG INFO:{str(e)}" |
1658 | 1688 | ) |
1659 | 1689 | return AquaResourceIdentifier() |
|
0 commit comments