Skip to content

Commit e7fca2e

Browse files
fix(metrics): qa_accuracy keyword-only aggregation
Remove redundant metric_units assignment; aggregation is keyword-only. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f2d5c5a commit e7fca2e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/pruna/evaluation/metrics/metric_qa_accuracy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,17 @@ def __init__(
120120
device: str | torch.device | None = None,
121121
api_key: str | None = None,
122122
call_type: str = SINGLE,
123+
*,
124+
aggregation: str = "mean",
123125
**kwargs: Any,
124126
) -> None:
125127
super().__init__(device=device)
126128
self.response_format = VQAnswer if structured_output else None
127-
self.aggregation = kwargs.pop("aggregation", "mean")
129+
self.aggregation = aggregation
128130
if self.aggregation not in {"mean", "all_or_nothing"}:
129131
raise ValueError(
130132
f"qa_accuracy aggregation must be one of {{'mean', 'all_or_nothing'}}. Got: {self.aggregation!r}."
131133
)
132-
self.metric_units = type(self).metric_units
133134
self._init_vlm_scores(
134135
vlm=vlm,
135136
vlm_type=vlm_type,

0 commit comments

Comments
 (0)