Andreas Sünder commited on
Commit
e155780
·
1 Parent(s): e92236d

Change file path checking

Browse files
Files changed (1) hide show
  1. simplebooks.py +1 -1
simplebooks.py CHANGED
@@ -115,7 +115,7 @@ class SimpleBooks(datasets.GeneratorBasedBuilder):
115
  def _generate_examples(self, subset, split, files):
116
  _id = 0
117
  for path, file in files:
118
- if path == f"{subset}/{split}.txt":
119
  for line in file:
120
  yield _id, {"text": line.strip()}
121
  _id += 1
 
115
  def _generate_examples(self, subset, split, files):
116
  _id = 0
117
  for path, file in files:
118
+ if path.contains(subset) and path.contains(f"{split}.txt"):
119
  for line in file:
120
  yield _id, {"text": line.strip()}
121
  _id += 1