Update openwebtext_split.py
Browse files- openwebtext_split.py +4 -2
openwebtext_split.py
CHANGED
|
@@ -19,6 +19,7 @@ import os
|
|
| 19 |
import re
|
| 20 |
from itertools import chain
|
| 21 |
import tarfile
|
|
|
|
| 22 |
|
| 23 |
import datasets
|
| 24 |
|
|
@@ -56,8 +57,9 @@ def custom_iter_archive(path_or_buf, _filter=lambda x: True):
|
|
| 56 |
continue
|
| 57 |
file_obj = stream.extractfile(tarinfo)
|
| 58 |
for j, xzinfo in enumerate(file_obj):
|
| 59 |
-
|
| 60 |
-
|
|
|
|
| 61 |
stream.members = []
|
| 62 |
del stream
|
| 63 |
if hasattr(path_or_buf, "read"):
|
|
|
|
| 19 |
import re
|
| 20 |
from itertools import chain
|
| 21 |
import tarfile
|
| 22 |
+
import io
|
| 23 |
|
| 24 |
import datasets
|
| 25 |
|
|
|
|
| 57 |
continue
|
| 58 |
file_obj = stream.extractfile(tarinfo)
|
| 59 |
for j, xzinfo in enumerate(file_obj):
|
| 60 |
+
f = io.BytesIO(xzinfo)
|
| 61 |
+
print(dir(f))
|
| 62 |
+
yield f.name, f
|
| 63 |
stream.members = []
|
| 64 |
del stream
|
| 65 |
if hasattr(path_or_buf, "read"):
|