Skip to content

Commit 0a42a96

Browse files
committed
fix
Signed-off-by: SumanthRH <sumanthrh@anyscale.com>
1 parent a4aa5de commit 0a42a96

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

tests/evals/tasks/test_mmlu.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class MockTaskConfig:
7-
templating_parameters = {"template": "{question}\n\nChoices:\n{choices}"}
7+
templating_parameters = {"template": "{prompt}"}
88
answer_key = "answer"
99
question_key = "question"
1010
choices_key = "choices"
@@ -17,7 +17,7 @@ class MockTaskConfig:
1717
{
1818
"question": "What is the capital of France?",
1919
"choices": "A) London\nB) Paris\nC) Berlin\nD) Madrid",
20-
"answer": "B",
20+
"answer": 1,
2121
},
2222
"The answer is B) Paris",
2323
True,
@@ -26,9 +26,9 @@ class MockTaskConfig:
2626
{
2727
"question": "Which element has the atomic number 1?",
2828
"choices": "A) Helium\nB) Oxygen\nC) Hydrogen\nD) Carbon",
29-
"answer": "C",
29+
"answer": 2,
3030
},
31-
"C",
31+
"A",
3232
False,
3333
),
3434
],
@@ -42,8 +42,12 @@ def test_check_correctness(problem, response, expected):
4242
"problem, expected",
4343
[
4444
(
45-
{"question": "What is the capital of France?", "answer": "B"},
46-
"What is the capital of France?\n\nChoices:\nA) London\nB) Paris\nC) Berlin\nD) Madrid",
45+
{
46+
"question": "What is the capital of France?",
47+
"answer": "B",
48+
"choices": ["London", "Paris", "Berlin", "Madrid"],
49+
},
50+
"What is the capital of France?\nAnswer Choices: (A) London (B) Paris (C) Berlin (D) Madrid",
4751
),
4852
],
4953
)

tests/evals/tasks/test_mmlu_pro.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class MockTaskConfig:
7-
templating_parameters = {"template": "Question: {question}\n\nChoices:\n{choices}"}
7+
templating_parameters = {"template": "Question: {prompt}"}
88
answer_key = "answer"
99
question_key = "question"
1010
choices_key = "choices"
@@ -47,12 +47,17 @@ def test_check_correctness(problem, response, expected):
4747
(
4848
{
4949
"question": "What is the main function of the left ventricle?",
50-
"choices": "A) Pumps blood to the lungs\nB) Pumps blood to the body\nC) Collects blood from the body\nD) Stores blood",
50+
"options": [
51+
"Pumps blood to the lungs",
52+
"Pumps blood to the body",
53+
"Collects blood from the body",
54+
"Stores blood",
55+
],
5156
"answer": "B",
5257
"answer_index": 1,
5358
},
54-
"Question: What is the main function of the left ventricle?\n\nChoices:"
55-
"\nA) Pumps blood to the lungs\nB) Pumps blood to the body\nC) Collects blood from the body\nD) Stores blood",
59+
"Question: What is the main function of the left ventricle?\n"
60+
"Answer Choices: (A) Pumps blood to the lungs (B) Pumps blood to the body (C) Collects blood from the body (D) Stores blood",
5661
),
5762
],
5863
)

0 commit comments

Comments
 (0)