Skip to content

Commit 5d9a4c7

Browse files
committed
refactor: allow evaluating mbpp+ tasks on mbpp base tests
1 parent 89b4c1d commit 5d9a4c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bigcode_eval/tasks/mbppplus.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
Homepage: https://github.com/evalplus/evalplus
1111
"""
1212

13+
import os
14+
1315
from bigcode_eval.tasks.mbpp import MBPP
1416
from bigcode_eval.tasks.custom_metrics.code_eval import compute_code_eval
1517

@@ -46,6 +48,9 @@ def get_prompt(self, doc):
4648
# is different from HumanEval(+) which further requires a `check` func
4749
def get_reference(self, doc):
4850
"""Builds the reference solution for the doc (sample from the test dataset)."""
51+
use_mbpp_tests = os.getenv("MBBPPLUS_USE_MBPP_TESTS", "0")
52+
if use_mbpp_tests == "1":
53+
return "\n".join(doc["test_list"])
4954
return "\n" + doc["test"]
5055

5156
def get_dataset(self):

0 commit comments

Comments
 (0)