File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -904,7 +904,9 @@ def get_status(self, eval_id: str) -> dict:
904
904
905
905
def get_supported_metrics (self ) -> dict :
906
906
"""Gets a list of supported metrics for evaluation."""
907
- return [item .to_dict () for item in evaluation_service_config ().metrics ]
907
+ return [
908
+ item .to_dict () for item in evaluation_service_config ().ui_config .metrics
909
+ ]
908
910
909
911
@telemetry (entry_point = "plugin=evaluation&action=load_metrics" , name = "aqua" )
910
912
def load_metrics (self , eval_id : str ) -> AquaEvalMetrics :
Original file line number Diff line number Diff line change 25
25
from ads .aqua .config .evaluation .evaluation_service_config import (
26
26
EvaluationServiceConfig ,
27
27
MetricConfig ,
28
+ UIConfig ,
28
29
)
29
30
from ads .aqua .constants import EVALUATION_REPORT_JSON , EVALUATION_REPORT_MD , UNKNOWN
30
31
from ads .aqua .evaluation import AquaEvaluationApp
@@ -886,25 +887,27 @@ def test_get_supported_metrics(self, mock_evaluation_service_config):
886
887
"""
887
888
888
889
test_evaluation_service_config = EvaluationServiceConfig (
889
- metrics = [
890
- MetricConfig (
891
- ** {
892
- "args" : {},
893
- "description" : "BERT Score." ,
894
- "key" : "bertscore" ,
895
- "name" : "BERT Score" ,
896
- "tags" : [],
897
- "task" : ["text-generation" ],
898
- },
899
- )
900
- ]
890
+ ui_config = UIConfig (
891
+ metrics = [
892
+ MetricConfig (
893
+ ** {
894
+ "args" : {},
895
+ "description" : "BERT Score." ,
896
+ "key" : "bertscore" ,
897
+ "name" : "BERT Score" ,
898
+ "tags" : [],
899
+ "task" : ["text-generation" ],
900
+ },
901
+ )
902
+ ]
903
+ )
901
904
)
902
905
mock_evaluation_service_config .return_value = test_evaluation_service_config
903
906
response = self .app .get_supported_metrics ()
904
907
assert isinstance (response , list )
905
- assert len (response ) == len (test_evaluation_service_config .metrics )
908
+ assert len (response ) == len (test_evaluation_service_config .ui_config . metrics )
906
909
assert response == [
907
- item .to_dict () for item in test_evaluation_service_config .metrics
910
+ item .to_dict () for item in test_evaluation_service_config .ui_config . metrics
908
911
]
909
912
910
913
def test_load_evaluation_config (self ):
You can’t perform that action at this time.
0 commit comments