@@ -534,8 +534,7 @@ async def _compute_metrics(
534
534
metric_name = metric
535
535
tasks_by_metric [metric_name ].append (task )
536
536
537
- api_request_count = (len (api_metrics ) + len (custom_metrics )) * len (
538
- evaluation_run_config .dataset )
537
+ api_request_count = len (api_metrics ) * len (evaluation_run_config .dataset )
539
538
_LOGGER .info (
540
539
f"Computing metrics with a total of { api_request_count } Vertex online"
541
540
" evaluation service requests."
@@ -629,7 +628,8 @@ def evaluate(
629
628
Raises:
630
629
ValueError: If the metrics list is empty, or the prompt template is not
631
630
provided for PairwiseMetric, or multiple baseline models are specified for
632
- PairwiseMetric instances.
631
+ PairwiseMetric instances, or both model and dataset model response column
632
+ are present.
633
633
"""
634
634
635
635
if not metrics :
@@ -655,6 +655,22 @@ def evaluate(
655
655
constants .Dataset .REFERENCE_COLUMN
656
656
)
657
657
658
+ if (
659
+ model
660
+ and evaluation_run_config .column_map .get (
661
+ constants .Dataset .MODEL_RESPONSE_COLUMN
662
+ )
663
+ in dataset .columns
664
+ ):
665
+ raise ValueError (
666
+ "The `model` parameter is specified, but the evaluation `dataset`"
667
+ f" contains model response column `{ response_column_name } ` to perform"
668
+ " bring-your-own-prediction(BYOP) evaluation. If you would like to"
669
+ " perform rapid evaluation using the dataset with the existing model"
670
+ f" response column `{ response_column_name } `, please remove the"
671
+ " `model` input parameter."
672
+ )
673
+
658
674
baseline_model = None
659
675
pairwise_metric_exists = any (
660
676
isinstance (metric , metrics_base .PairwiseMetric )
0 commit comments