mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00

* Update JuderBench * Support O1-style Prompts * Update Code * Update OpenAI * Update BigCodeBench * Update BigCodeBench * Update BigCodeBench * Update BigCodeBench * Update BigCodeBench * Update
26 lines
679 B
Python
26 lines
679 B
Python
import json
|
|
|
|
from datasets import Dataset
|
|
|
|
from opencompass.registry import LOAD_DATASET
|
|
from opencompass.utils import get_data_path
|
|
|
|
from .base import BaseDataset
|
|
|
|
|
|
@LOAD_DATASET.register_module()
|
|
class Aime2024Dataset(BaseDataset):
|
|
|
|
@staticmethod
|
|
def load(path, **kwargs):
|
|
path = get_data_path(path)
|
|
dataset = []
|
|
with open(path, 'r') as f:
|
|
for line in f:
|
|
line = json.loads(line)
|
|
origin_prompt = line['origin_prompt']
|
|
line['question'] = origin_prompt[:]
|
|
line['answer'] = line['gold_answer']
|
|
dataset.append(line)
|
|
return Dataset.from_list(dataset)
|