nthngdy commited on
Commit
29064ed
·
1 Parent(s): bf580b3

Update openwebtext_split.py

Browse files
Files changed (1) hide show
  1. 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
- print(dir(f))
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, (filepath, f) in enumerate(files):
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()}