-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
108 lines (101 loc) · 3.92 KB
/
__init__.py
File metadata and controls
108 lines (101 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from nemo_rl.data.datasets.eval_datasets.aime import AIMEDataset
from nemo_rl.data.datasets.eval_datasets.gpqa import GPQADataset
from nemo_rl.data.datasets.eval_datasets.local_math_dataset import LocalMathDataset
from nemo_rl.data.datasets.eval_datasets.math import MathDataset
from nemo_rl.data.datasets.eval_datasets.mmlu import MMLUDataset
from nemo_rl.data.datasets.eval_datasets.mmlu_pro import MMLUProDataset
def load_eval_dataset(data_config):
"""Loads evaluation dataset."""
dataset_name = data_config["dataset_name"]
# mmlu
if dataset_name.startswith("mmlu") and dataset_name != "mmlu_pro":
if dataset_name == "mmlu":
base_dataset = MMLUDataset(
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
else:
language = dataset_name.split("_")[1]
base_dataset = MMLUDataset(
language=language,
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
elif dataset_name == "mmlu_pro":
base_dataset = MMLUProDataset(
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
# aime
elif dataset_name == "aime2024":
base_dataset = AIMEDataset(
variant="2024",
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
elif dataset_name == "aime2025":
base_dataset = AIMEDataset(
variant="2025",
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
# gpqa
elif dataset_name == "gpqa":
base_dataset = GPQADataset(
variant="main",
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
elif dataset_name == "gpqa_diamond":
base_dataset = GPQADataset(
variant="diamond",
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
# math
elif dataset_name == "math":
base_dataset = MathDataset(
variant="math_test",
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
elif dataset_name == "math500":
base_dataset = MathDataset(
variant="math_500_test",
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
# fall back to local dataset
else:
print(f"Loading dataset from {dataset_name}...")
base_dataset = LocalMathDataset(
data_path=dataset_name,
problem_key=data_config["problem_key"],
solution_key=data_config["solution_key"],
file_format=data_config["file_format"],
split=data_config["split"],
prompt_file=data_config["prompt_file"],
system_prompt_file=data_config["system_prompt_file"],
)
return base_dataset
__all__ = [
"AIMEDataset",
"GPQADataset",
"LocalMathDataset",
"MathDataset",
"MMLUDataset",
"MMLUProDataset",
]