Update testcm.py
Browse files
testcm.py
CHANGED
@@ -93,10 +93,9 @@ class CodeMMLU(datasets.GeneratorBasedBuilder):
|
|
93 |
if data_path.endswith(".jsonl"):
|
94 |
lines = open(data_path, "r", encoding="utf-8").readlines()
|
95 |
reader = [json.loads(line) for line in lines]
|
96 |
-
for data in reader:
|
97 |
-
id_ = data['task_id']
|
98 |
-
|
99 |
return_dict = {
|
|
|
100 |
"question": data['question'],
|
101 |
"choices": data['choices'],
|
102 |
}
|
@@ -104,4 +103,4 @@ class CodeMMLU(datasets.GeneratorBasedBuilder):
|
|
104 |
if "fill_in_the_middle" in data_path:
|
105 |
return_dict['problem_description'] = data['problem_description']
|
106 |
|
107 |
-
yield
|
|
|
93 |
if data_path.endswith(".jsonl"):
|
94 |
lines = open(data_path, "r", encoding="utf-8").readlines()
|
95 |
reader = [json.loads(line) for line in lines]
|
96 |
+
for idx, data in enumerate(reader):
|
|
|
|
|
97 |
return_dict = {
|
98 |
+
"task_id": data['task_id'],
|
99 |
"question": data['question'],
|
100 |
"choices": data['choices'],
|
101 |
}
|
|
|
103 |
if "fill_in_the_middle" in data_path:
|
104 |
return_dict['problem_description'] = data['problem_description']
|
105 |
|
106 |
+
yield idx, return_dict
|