File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ def _convert(m: str | dict | Metric) -> Metric:
171
171
unique_names = {m .name for m in unique_metrics }
172
172
if len (unique_names ) != len (unique_metrics ):
173
173
raise InvalidBenchmarkError (
174
- "The benchmark has similarly named metrics . Specify a custom name with Metric(custom_name=...)"
174
+ "The metrics of a benchmark need to have unique names . Specify a custom name with Metric(custom_name=...)"
175
175
)
176
176
177
177
return unique_metrics
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ class Metric(BaseModel):
285
285
286
286
label : MetricLabel
287
287
config : GroupedMetricConfig | None = None
288
- custom_name : str | None = Field (None , exclude = True )
288
+ custom_name : str | None = Field (None , exclude = True , alias = "name" )
289
289
290
290
# Frozen metadata
291
291
fn : Callable = Field (frozen = True , exclude = True )
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ def test_benchmark_duplicate_metrics(test_single_task_benchmark):
233
233
m ["main_metric" ] = m ["metrics" ][0 ]
234
234
SingleTaskBenchmarkSpecification (** m )
235
235
236
- with pytest .raises (ValidationError , match = "The benchmark has similarly named metrics " ):
236
+ with pytest .raises (ValidationError , match = "The metrics of a benchmark need to have unique names. " ):
237
237
m ["metrics" ][0 ].config .group_by = "MULTICLASS_calc"
238
238
SingleTaskBenchmarkSpecification (** m )
239
239
You can’t perform that action at this time.
0 commit comments