Update proof-pile-2.py
#5
by
hails
- opened
- proof-pile-2.py +80 -4
proof-pile-2.py
CHANGED
@@ -19,6 +19,82 @@ A dataset of high quality mathematical text. """
|
|
19 |
_HOMEPAGE = "https://github.com/EleutherAI/math-lm"
|
20 |
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
class ProofPile2Config(datasets.BuilderConfig):
|
23 |
"""BuilderConfig for RedPajama sample."""
|
24 |
|
@@ -95,11 +171,11 @@ class ProofPile2(datasets.GeneratorBasedBuilder):
|
|
95 |
# These kwargs will be passed to _generate_examples
|
96 |
gen_kwargs={
|
97 |
"data_files": list(map(
|
98 |
-
dl_manager.
|
99 |
[
|
100 |
-
x
|
101 |
-
for subset in self.config.subsets
|
102 |
-
for x in
|
103 |
]
|
104 |
))
|
105 |
},
|
|
|
19 |
_HOMEPAGE = "https://github.com/EleutherAI/math-lm"
|
20 |
|
21 |
|
22 |
+
# hacky workaround: listing out files here for download, because removing dataloader script entirely introduced another bug
|
23 |
+
_ARXIV_FILES = {
|
24 |
+
"train": [f"arXiv_{i:03}.jsonl.zst" for i in range(100)],
|
25 |
+
"validation": [f"arXiv_{i:03}.jsonl.zst" for i in range(100)],
|
26 |
+
"test": [f"arXiv_{i:03}.jsonl.zst" for i in range(100)],
|
27 |
+
}
|
28 |
+
_OWM_FILES = {
|
29 |
+
"train": [f"shard-{i:04}.jsonl.zst" for i in range(63)],
|
30 |
+
"validation": ["val.jsonl.zst"],
|
31 |
+
"test": ["test.jsonl.zst"],
|
32 |
+
}
|
33 |
+
_ALGSTACK_FILES = {
|
34 |
+
"train": ["agda0000.jsonl.zst", "c0000.jsonl.zst"]
|
35 |
+
+ [f"cpp{i:04}.jsonl.zst" for i in range(5)]
|
36 |
+
+ [f"fortran{i:04}.jsonl.zst" for i in range(4)]
|
37 |
+
+ ["gap0000.jsonl.zst"]
|
38 |
+
+ [f"github-MATLAB-train-{i:04}.jsonl.zst" for i in range(4)]
|
39 |
+
+ [f"github-coq-train-{i:04}.jsonl.zst" for i in range(3)]
|
40 |
+
+ ["github-isabelle-train-0000.jsonl.zst", "github-lean-train-0000.jsonl.zst"]
|
41 |
+
+ ["haskell0000.jsonl.zst", "idris0000.jsonl.zst", "isa_proofsteps.jsonl.zst"]
|
42 |
+
+ [f"julia{i:04}.jsonl.zst" for i in range(6)]
|
43 |
+
+ ["jupyter-notebook0000.jsonl.zst", "lean_proofsteps.jsonl.zst", "maple0000.jsonl.zst"]
|
44 |
+
+ [f"python{i:04}.jsonl.zst" for i in range(42)]
|
45 |
+
+ ["r0000.jsonl.zst"]
|
46 |
+
+ [f"tex{i:04}.jsonl.zst" for i in range(3)],
|
47 |
+
"validation": [
|
48 |
+
"agda-validation.jsonl.zst",
|
49 |
+
"c-validation.jsonl.zst",
|
50 |
+
"cpp-validation.jsonl.zst",
|
51 |
+
"fortran-validation.jsonl.zst",
|
52 |
+
"gap-validation.jsonl.zst",
|
53 |
+
"github-MATLAB-validation-0000.jsonl.zst",
|
54 |
+
"github-coq-validation-0000.jsonl.zst",
|
55 |
+
"github-isabelle-validation-0000.jsonl.zst",
|
56 |
+
"github-lean-validation-0000.jsonl.zst",
|
57 |
+
"haskell-validation.jsonl.zst",
|
58 |
+
"idris-validation.jsonl.zst",
|
59 |
+
"isa_proofsteps.jsonl.zst",
|
60 |
+
"julia-validation.jsonl.zst",
|
61 |
+
"jupyter-notebook-validation.jsonl.zst",
|
62 |
+
"lean_proofsteps.jsonl.zst",
|
63 |
+
"maple-validation.jsonl.zst",
|
64 |
+
"python-validation.jsonl.zst",
|
65 |
+
"r-validation.jsonl.zst",
|
66 |
+
"tex-validation.jsonl.zst",
|
67 |
+
],
|
68 |
+
"test": [
|
69 |
+
"agda-test.jsonl.zst",
|
70 |
+
"c-test.jsonl.zst",
|
71 |
+
"cpp-test.jsonl.zst",
|
72 |
+
"fortran-test.jsonl.zst",
|
73 |
+
"gap-test.jsonl.zst",
|
74 |
+
"github-MATLAB-test-0000.jsonl.zst",
|
75 |
+
"github-coq-test-0000.jsonl.zst",
|
76 |
+
"github-isabelle-test-0000.jsonl.zst",
|
77 |
+
"github-lean-test-0000.jsonl.zst",
|
78 |
+
"haskell-test.jsonl.zst",
|
79 |
+
"idris-test.jsonl.zst",
|
80 |
+
"isa_proofsteps.jsonl.zst",
|
81 |
+
"julia-test.jsonl.zst",
|
82 |
+
"jupyter-notebook-test.jsonl.zst",
|
83 |
+
"lean_proofsteps.jsonl.zst",
|
84 |
+
"maple-test.jsonl.zst",
|
85 |
+
"python-test.jsonl.zst",
|
86 |
+
"r-test.jsonl.zst",
|
87 |
+
"tex-test.jsonl.zst",
|
88 |
+
]
|
89 |
+
}
|
90 |
+
|
91 |
+
_FILES_MAPPING = {
|
92 |
+
"arxiv": _ARXIV_FILES,
|
93 |
+
"open-web-math": _OWM_FILES,
|
94 |
+
"algebraic-stack": _ALGSTACK_FILES,
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
class ProofPile2Config(datasets.BuilderConfig):
|
99 |
"""BuilderConfig for RedPajama sample."""
|
100 |
|
|
|
171 |
# These kwargs will be passed to _generate_examples
|
172 |
gen_kwargs={
|
173 |
"data_files": list(map(
|
174 |
+
dl_manager.download_and_extract,
|
175 |
[
|
176 |
+
f"https://huggingface.co/datasets/EleutherAI/proof-pile-2/resolve/main/{subset}/{split}/{x}"
|
177 |
+
for subset in self.config.subsets
|
178 |
+
for x in _FILES_MAPPING[subset][split]
|
179 |
]
|
180 |
))
|
181 |
},
|