Andreas Sünder
commited on
Commit
·
3c725d1
1
Parent(s):
1872f18
Final fix for file name matching
Browse files- simplebooks.py +2 -1
simplebooks.py
CHANGED
|
@@ -115,7 +115,8 @@ class SimpleBooks(datasets.GeneratorBasedBuilder):
|
|
| 115 |
def _generate_examples(self, subset, split, files):
|
| 116 |
_id = 0
|
| 117 |
for path, file in files:
|
| 118 |
-
|
|
|
|
| 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 |
+
head, tail = os.path.split(path)
|
| 119 |
+
if head.endswith(f"{subset}/") and tail == f"{split}.txt":
|
| 120 |
for line in file:
|
| 121 |
yield _id, {"text": line.strip()}
|
| 122 |
_id += 1
|