sadrasabouri commited on
Commit
1aa031b
1 Parent(s): a5ae8a0

Update naab.py

Browse files
Files changed (1) hide show
  1. naab.py +10 -9
naab.py CHANGED
@@ -106,24 +106,25 @@ class Naab(datasets.GeneratorBasedBuilder):
106
  datasets.SplitGenerator(
107
  name=datasets.Split.TRAIN,
108
  gen_kwargs={
109
- "filepath": train_downloaded_files,
110
  "split": "train"
111
  }
112
  ),
113
  datasets.SplitGenerator(
114
  name=datasets.Split.TEST,
115
  gen_kwargs={
116
- "filepath": test_downloaded_files,
117
  "split": "test"
118
  }
119
  ),
120
  ]
121
 
122
 
123
- def _generate_examples(self, filepath, split):
124
- with open(filepath, encoding="utf-8") as f:
125
- for key, row in enumerate(f):
126
- if row.strip():
127
- yield idx, {"text": row}
128
- else:
129
- yield idx, {"text": ""}
 
 
106
  datasets.SplitGenerator(
107
  name=datasets.Split.TRAIN,
108
  gen_kwargs={
109
+ "filepaths": train_downloaded_files,
110
  "split": "train"
111
  }
112
  ),
113
  datasets.SplitGenerator(
114
  name=datasets.Split.TEST,
115
  gen_kwargs={
116
+ "filepaths": test_downloaded_files,
117
  "split": "test"
118
  }
119
  ),
120
  ]
121
 
122
 
123
+ def _generate_examples(self, filepaths, split):
124
+ for filepath in filepaths:
125
+ with open(filepath, encoding="utf-8") as f:
126
+ for key, row in enumerate(f):
127
+ if row.strip():
128
+ yield key, {"text": row}
129
+ else:
130
+ yield key, {"text": ""}