Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
Zhangir Azerbayev commited on
Commit ·
d06970b
1
Parent(s): f3afa17
gotta be it now
Browse files- proof-pile.py +17 -8
proof-pile.py
CHANGED
|
@@ -189,13 +189,22 @@ class ProofPile(datasets.GeneratorBasedBuilder):
|
|
| 189 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 190 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
| 191 |
key = 0
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
text =
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
}
|
| 201 |
key += 1
|
|
|
|
| 189 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 190 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
| 191 |
key = 0
|
| 192 |
+
if self.config.name in self.archived_configs:
|
| 193 |
+
for name, obj in data_files:
|
| 194 |
+
text = obj.read()
|
| 195 |
+
# Yields examples as (key, example) tuples
|
| 196 |
+
yield key, {
|
| 197 |
+
"config": self.config.name,
|
| 198 |
+
"file": name,
|
| 199 |
+
"text": text,
|
| 200 |
+
else:
|
| 201 |
+
for name in data_files:
|
| 202 |
+
with open(name, encoding="utf-8") as f:
|
| 203 |
+
text = f.read()
|
| 204 |
+
# Yields examples as (key, example) tuples
|
| 205 |
+
yield key, {
|
| 206 |
+
"config": self.config.name,
|
| 207 |
+
"file": name,
|
| 208 |
+
"text": text,
|
| 209 |
}
|
| 210 |
key += 1
|