Skip to content

Commit 226d999

Browse files
authored
Fix Task.to_dict() with dict-based metrics (#38)
1 parent 872a76e commit 226d999

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/fev/metrics.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ def get_metric(metric: MetricConfig) -> Metric:
4949
if isinstance(metric, str):
5050
return metric_type()
5151
elif isinstance(metric, dict):
52-
metric_name = metric.pop("name")
53-
return metric_type(**metric)
52+
return metric_type(**{k: v for k, v in metric.items() if k != "name"})
5453
else:
5554
raise ValueError(f"Invalid metric configuration: {metric}")
5655

0 commit comments

Comments
 (0)