hf-transformers-bot lhoestq HF staff commited on
Commit
cbe8a8a
1 Parent(s): 09fe056

Make the dataset deterministic (#1)

Browse files

- Make the dataset deterministic (a42cf488e722e4180fbc156f730f0d68e9273d7b)


Co-authored-by: Quentin Lhoest <lhoestq@users.noreply.huggingface.co>

Files changed (1) hide show
  1. cats_vs_dogs_sample.py +1 -1
cats_vs_dogs_sample.py CHANGED
@@ -70,7 +70,7 @@ class CatsVsDogs(datasets.GeneratorBasedBuilder):
70
 
71
  def _generate_examples(self, images_path):
72
  logger.info("generating examples from = %s", images_path)
73
- for i, filepath in enumerate(images_path.glob("**/*.jpg")):
74
  yield str(i), {
75
  "image": str(filepath),
76
  "labels": filepath.parent.name.lower(),
70
 
71
  def _generate_examples(self, images_path):
72
  logger.info("generating examples from = %s", images_path)
73
+ for i, filepath in enumerate(sorted(images_path.glob("**/*.jpg"))):
74
  yield str(i), {
75
  "image": str(filepath),
76
  "labels": filepath.parent.name.lower(),