Skip to content

Commit 0f28ea4

Browse files
JoelNiklausNathanHBclefourrier
authored
Fixes an error with getting the golds from the formatted_docs. (#388)
* Fixes an error with getting the golds from the formatted_docs. * Only taking the first gold element. --------- Co-authored-by: Nathan Habib <[email protected]> Co-authored-by: Clémentine Fourrier <[email protected]>
1 parent 3e1a66f commit 0f28ea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lighteval/metrics/metrics_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def compute(self, sample_ids: list[str], responses: list, formatted_docs: list[D
926926
"""
927927
questions = [formatted_doc.specific["question"] for formatted_doc in formatted_docs]
928928
options = [formatted_doc.choices for formatted_doc in formatted_docs]
929-
golds = [formatted_doc.choices[formatted_doc.gold_index[0]] for formatted_doc in formatted_docs]
929+
golds = [formatted_doc.get_golds()[0] for formatted_doc in formatted_docs]
930930
predictions = [response[0].result[0] for response in responses]
931931

932932
scores, messages, judgements = self.judge.evaluate_answer_batch(questions, predictions, options, golds)

0 commit comments

Comments
 (0)