Skip to content

Commit b597546

Browse files
committed
fix metrics kwargs passing
1 parent 1e139ab commit b597546

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/lighteval/metrics/metrics_sample.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ def __init__(self, k: int | None = None, **kwargs):
11611161
sample_scoring_function (callable | str, optional): Function to use to compute the score for each sample.
11621162
If None, uses the default scoring function which is a simple exact match.
11631163
"""
1164-
super().__init__(kwargs)
1164+
super().__init__(**kwargs)
11651165
self.k = k
11661166
self.attribute_must_be_set = ["k"]
11671167

@@ -1191,7 +1191,7 @@ def num_samples(self):
11911191
class MajAtK(SamplingMetric, SampleLevelComputation):
11921192
def __init__(self, k: int = None, **kwargs):
11931193
"""An exact match class."""
1194-
super().__init__(kwargs)
1194+
super().__init__(**kwargs)
11951195

11961196
self.k = k
11971197
self.attribute_must_be_set = ["k"]
@@ -1241,7 +1241,7 @@ def __init__(self, k: int | None = None, n: int | None = None, **kwargs):
12411241
k (int): Threshold for the number of successful attempts.
12421242
n (int): Number of samples to generate
12431243
"""
1244-
super().__init__(kwargs)
1244+
super().__init__(**kwargs)
12451245
self.k = k
12461246
self.n = n
12471247
self.attribute_must_be_set = ["k"]
@@ -1269,7 +1269,7 @@ def compute(self, doc: Doc, model_response: ModelResponse, **kwargs) -> float:
12691269
elif len(predictions) < self.n:
12701270
logger.warning(f"Number of predictions is less than {self.n} for pass@k.")
12711271

1272-
processed_choices = [self.preprocess(gold=g) for g in doc.choices]
1272+
processed_choices = [self.preprocess(g) for g in doc.choices]
12731273
new_doc = Doc(
12741274
choices=processed_choices,
12751275
query=doc.query,
@@ -1278,7 +1278,7 @@ def compute(self, doc: Doc, model_response: ModelResponse, **kwargs) -> float:
12781278

12791279
all_scores = []
12801280
for pred in predictions[: self.n]:
1281-
cur_pred = self.preprocess(pred=pred)
1281+
cur_pred = self.preprocess(pred)
12821282
new_model_response = ModelResponse(
12831283
text=[cur_pred],
12841284
)
@@ -1314,7 +1314,7 @@ def __init__(
13141314
n (int): Number of samples to generate.
13151315
thresholds (list): Thresholds to control successful attempts in k generate.
13161316
"""
1317-
super().__init__(kwargs)
1317+
super().__init__(**kwargs)
13181318
self._k = k
13191319
self.n = n
13201320
self.attribute_must_be_set = ["k"]

0 commit comments

Comments
 (0)