lhoestq HF staff commited on
Commit
a0d0eca
1 Parent(s): d444bf3

Pass a list instead of an iterator

Browse files

This should fix the dataset viewer.

Iterators are stateful, so if you use the dataset several times or load it in streaming you can end up with an empty iterator in `files`

Files changed (1) hide show
  1. NIH-Chest-X-ray-dataset.py +2 -2
NIH-Chest-X-ray-dataset.py CHANGED
@@ -195,14 +195,14 @@ class ChestXray14(datasets.GeneratorBasedBuilder):
195
  datasets.SplitGenerator(
196
  name=datasets.Split.TRAIN,
197
  gen_kwargs={
198
- "files": iter(train_files)
199
  }
200
 
201
  ),
202
  datasets.SplitGenerator(
203
  name=datasets.Split.TEST,
204
  gen_kwargs={
205
- "files": iter(test_files)
206
  }
207
  )
208
  ]
 
195
  datasets.SplitGenerator(
196
  name=datasets.Split.TRAIN,
197
  gen_kwargs={
198
+ "files": train_files
199
  }
200
 
201
  ),
202
  datasets.SplitGenerator(
203
  name=datasets.Split.TEST,
204
  gen_kwargs={
205
+ "files": test_files
206
  }
207
  )
208
  ]