Update openwebtext_split.py
Browse files- openwebtext_split.py +3 -2
openwebtext_split.py
CHANGED
@@ -59,9 +59,10 @@ def custom_iter_archive(path_or_buf, _filter=lambda x: True):
|
|
59 |
file_obj = stream.extractfile(tarinfo)
|
60 |
decompressed = tarfile.open(fileobj=file_obj, mode='r:xz')
|
61 |
for j, xzinfo in enumerate(decompressed):
|
62 |
-
|
|
|
63 |
txt_file = decompressed.extractfile(xzinfo)
|
64 |
-
yield
|
65 |
stream.members = []
|
66 |
del stream
|
67 |
if hasattr(path_or_buf, "read"):
|
|
|
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
|
64 |
txt_file = decompressed.extractfile(xzinfo)
|
65 |
+
yield txt_file
|
66 |
stream.members = []
|
67 |
del stream
|
68 |
if hasattr(path_or_buf, "read"):
|