Update openwebtext_split.py
Browse files- openwebtext_split.py +2 -2
openwebtext_split.py
CHANGED
|
@@ -57,7 +57,7 @@ def custom_iter_archive(path_or_buf, _filter=lambda x: True):
|
|
| 57 |
if not file_path.endswith('xz'):
|
| 58 |
continue
|
| 59 |
file_obj = stream.extractfile(tarinfo)
|
| 60 |
-
decompressed = tarfile.open(fileobj=file_obj, mode='r
|
| 61 |
for j, xzinfo in enumerate(decompressed):
|
| 62 |
if not xzinfo.name.endswith('txt'):
|
| 63 |
continue
|
|
@@ -105,5 +105,5 @@ class Openwebtext(datasets.GeneratorBasedBuilder):
|
|
| 105 |
def _generate_examples(self, files):
|
| 106 |
"""Yields examples."""
|
| 107 |
for idx, f in enumerate(files):
|
| 108 |
-
print(
|
| 109 |
yield idx, {"text": re.sub("\n\n\n+", "\n\n", f.read()).strip()}
|
|
|
|
| 57 |
if not file_path.endswith('xz'):
|
| 58 |
continue
|
| 59 |
file_obj = stream.extractfile(tarinfo)
|
| 60 |
+
decompressed = tarfile.open(fileobj=file_obj, mode='r:xz')
|
| 61 |
for j, xzinfo in enumerate(decompressed):
|
| 62 |
if not xzinfo.name.endswith('txt'):
|
| 63 |
continue
|
|
|
|
| 105 |
def _generate_examples(self, files):
|
| 106 |
"""Yields examples."""
|
| 107 |
for idx, f in enumerate(files):
|
| 108 |
+
print(f.readlines())
|
| 109 |
yield idx, {"text": re.sub("\n\n\n+", "\n\n", f.read()).strip()}
|