Update openwebtext_split.py
Browse files- openwebtext_split.py +2 -4
openwebtext_split.py
CHANGED
|
@@ -58,8 +58,7 @@ def custom_iter_archive(path_or_buf, _filter=lambda x: True):
|
|
| 58 |
file_obj = stream.extractfile(tarinfo)
|
| 59 |
for j, xzinfo in enumerate(file_obj):
|
| 60 |
f = io.BytesIO(xzinfo)
|
| 61 |
-
|
| 62 |
-
yield f.name, f
|
| 63 |
stream.members = []
|
| 64 |
del stream
|
| 65 |
if hasattr(path_or_buf, "read"):
|
|
@@ -101,6 +100,5 @@ class Openwebtext(datasets.GeneratorBasedBuilder):
|
|
| 101 |
|
| 102 |
def _generate_examples(self, files):
|
| 103 |
"""Yields examples."""
|
| 104 |
-
for idx,
|
| 105 |
-
print(filepath)
|
| 106 |
yield idx, {"text": re.sub("\n\n\n+", "\n\n", f.read().decode()).strip()}
|
|
|
|
| 58 |
file_obj = stream.extractfile(tarinfo)
|
| 59 |
for j, xzinfo in enumerate(file_obj):
|
| 60 |
f = io.BytesIO(xzinfo)
|
| 61 |
+
yield f
|
|
|
|
| 62 |
stream.members = []
|
| 63 |
del stream
|
| 64 |
if hasattr(path_or_buf, "read"):
|
|
|
|
| 100 |
|
| 101 |
def _generate_examples(self, files):
|
| 102 |
"""Yields examples."""
|
| 103 |
+
for idx, f in enumerate(files):
|
|
|
|
| 104 |
yield idx, {"text": re.sub("\n\n\n+", "\n\n", f.read().decode()).strip()}
|