Skip to content

Commit 6524c6a

Browse files
wrong attribute self.k -> self.n (#1049)
Co-authored-by: Francesco Bertolotti <[email protected]>
1 parent 2247df7 commit 6524c6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lighteval/metrics/metrics_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ def compute(self, doc: Doc, model_response: ModelResponse, **kwargs):
11991199
float: Aggregated score over the current sample's items.
12001200
"""
12011201
all_scores = []
1202-
for i in range(self.k):
1202+
for i in range(self.n):
12031203
all_scores.append(self.compute_score(doc, model_response[i]))
12041204

12051205
avg_score = np.mean(all_scores)
@@ -1235,7 +1235,7 @@ def compute(self, doc: Doc, model_response: ModelResponse, **kwargs):
12351235
Returns:
12361236
float: Aggregated score over the current sample's items.
12371237
"""
1238-
if self.k is None:
1238+
if self.n is None:
12391239
raise Exception("You did not set the value of n")
12401240

12411241
golds = doc.get_golds()

0 commit comments

Comments
 (0)