nthngdy commited on
Commit
a07556b
1 Parent(s): d3aad52

Update openwebtext_split.py

Browse files
Files changed (1) hide show
  1. 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
- print(xzinfo.name)
 
63
  txt_file = decompressed.extractfile(xzinfo)
64
- yield xzinfo.name, txt_file
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"):