mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
[Update] Update Math auto-download data (#1700)
This commit is contained in:
parent
98242ff1d1
commit
ab8fdbbaab
@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
from os import environ
|
from os import environ
|
||||||
|
|
||||||
@ -140,7 +141,7 @@ def extract_answer(response_text: str):
|
|||||||
class MATHDataset(BaseDataset):
|
class MATHDataset(BaseDataset):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load(path: str):
|
def load(path: str, file_name: str = 'math.json'):
|
||||||
path = get_data_path(path)
|
path = get_data_path(path)
|
||||||
dataset = DatasetDict()
|
dataset = DatasetDict()
|
||||||
raw_data = []
|
raw_data = []
|
||||||
@ -155,7 +156,8 @@ class MATHDataset(BaseDataset):
|
|||||||
extract_boxed_answer(item['solution'])
|
extract_boxed_answer(item['solution'])
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
data = json.load(open(path))
|
file_path = os.path.join(path, file_name)
|
||||||
|
data = json.load(open(file_path))
|
||||||
for i in data.keys():
|
for i in data.keys():
|
||||||
raw_data.append({
|
raw_data.append({
|
||||||
'problem':
|
'problem':
|
||||||
|
@ -167,7 +167,7 @@ DATASETS_MAPPING = {
|
|||||||
"opencompass/math": {
|
"opencompass/math": {
|
||||||
"ms_id": "opencompass/math",
|
"ms_id": "opencompass/math",
|
||||||
"hf_id": "opencompass/math",
|
"hf_id": "opencompass/math",
|
||||||
"local": "./data/math/math.json",
|
"local": "./data/math/",
|
||||||
},
|
},
|
||||||
# MMLU
|
# MMLU
|
||||||
"opencompass/mmlu": {
|
"opencompass/mmlu": {
|
||||||
@ -327,7 +327,7 @@ DATASETS_MAPPING = {
|
|||||||
"hf_id": "",
|
"hf_id": "",
|
||||||
"local": "./data/mmmlu_lite",
|
"local": "./data/mmmlu_lite",
|
||||||
},
|
},
|
||||||
"opencompass/musr": {
|
"opencompass/musr": {
|
||||||
"ms_id": "",
|
"ms_id": "",
|
||||||
"hf_id": "",
|
"hf_id": "",
|
||||||
"local": "./data/musr",
|
"local": "./data/musr",
|
||||||
@ -374,7 +374,7 @@ DATASETS_URL = {
|
|||||||
},
|
},
|
||||||
"/math/": {
|
"/math/": {
|
||||||
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/math.zip",
|
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/math.zip",
|
||||||
"md5": "8b1b897259684672055e6fd4fc07c808",
|
"md5": "cb5b4c8378085929e20345174e731fdf",
|
||||||
},
|
},
|
||||||
"/hellaswag/": {
|
"/hellaswag/": {
|
||||||
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/hellaswag.zip",
|
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/hellaswag.zip",
|
||||||
@ -540,8 +540,8 @@ DATASETS_URL = {
|
|||||||
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/WikiBench.zip",
|
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/WikiBench.zip",
|
||||||
"md5": "6dac1d1a3133fe1effff185cbf71d928",
|
"md5": "6dac1d1a3133fe1effff185cbf71d928",
|
||||||
},
|
},
|
||||||
"/babilong":{
|
"/babilong": {
|
||||||
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/babilong.zip",
|
"url": "http://opencompass.oss-cn-shanghai.aliyuncs.com/datasets/data/babilong.zip",
|
||||||
"md5": "e400864c31bc58d29eaa3e199751f99b",
|
"md5": "e400864c31bc58d29eaa3e199751f99b",
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user