ncoop57
commited on
Commit
·
f820dfc
1
Parent(s):
b5a4c50
Add downloading the data folder
Browse files
mmmlu.py
CHANGED
@@ -52,6 +52,7 @@ _URLS = {
|
|
52 |
"dev": list((ROOT / "dev").glob("*.csv")),
|
53 |
"test": list((ROOT / "test").glob("*.csv")),
|
54 |
}
|
|
|
55 |
CONFIG_NAMES = [
|
56 |
"abstract_algebra",
|
57 |
"high_school_mathematics",
|
@@ -167,23 +168,25 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
167 |
)
|
168 |
|
169 |
def _split_generators(self, dl_manager):
|
|
|
|
|
170 |
return [
|
171 |
datasets.SplitGenerator(
|
172 |
name="dev",
|
173 |
gen_kwargs={
|
174 |
-
"filename":
|
175 |
}
|
176 |
),
|
177 |
datasets.SplitGenerator(
|
178 |
name=datasets.Split.VALIDATION,
|
179 |
gen_kwargs={
|
180 |
-
"filename":
|
181 |
}
|
182 |
),
|
183 |
datasets.SplitGenerator(
|
184 |
name=datasets.Split.TEST,
|
185 |
gen_kwargs={
|
186 |
-
"filename":
|
187 |
}
|
188 |
)
|
189 |
]
|
|
|
52 |
"dev": list((ROOT / "dev").glob("*.csv")),
|
53 |
"test": list((ROOT / "test").glob("*.csv")),
|
54 |
}
|
55 |
+
_URL = "https://people.eecs.berkeley.edu/~hendrycks/data.tar"
|
56 |
CONFIG_NAMES = [
|
57 |
"abstract_algebra",
|
58 |
"high_school_mathematics",
|
|
|
168 |
)
|
169 |
|
170 |
def _split_generators(self, dl_manager):
|
171 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
172 |
+
data_dir = Path(data_dir)
|
173 |
return [
|
174 |
datasets.SplitGenerator(
|
175 |
name="dev",
|
176 |
gen_kwargs={
|
177 |
+
"filename": data_dir / f"dev/{self.config.name}_dev.csv",
|
178 |
}
|
179 |
),
|
180 |
datasets.SplitGenerator(
|
181 |
name=datasets.Split.VALIDATION,
|
182 |
gen_kwargs={
|
183 |
+
"filename": data_dir / f"val/{self.config.name}_val.csv",
|
184 |
}
|
185 |
),
|
186 |
datasets.SplitGenerator(
|
187 |
name=datasets.Split.TEST,
|
188 |
gen_kwargs={
|
189 |
+
"filename": data_dir / f"test/{self.config.name}_test.csv",
|
190 |
}
|
191 |
)
|
192 |
]
|