memoryai commited on
Commit
ed16a36
·
verified ·
1 Parent(s): 5187e4e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/training/train_flux_v2.py +6 -2
scripts/training/train_flux_v2.py CHANGED
@@ -82,10 +82,14 @@ def preprocess(sample):
82
  return None
83
 
84
 
 
 
 
 
85
  dataset = (
86
- wds.WebDataset([str(f) for f in tar_files], shardshuffle=True)
87
  .shuffle(1000)
88
- .decode("pil")
89
  .map(preprocess)
90
  .select(lambda x: x is not None)
91
  )
 
82
  return None
83
 
84
 
85
+ def ignore_errors(exn):
86
+ print(f"WebDataset error (skipping): {exn}")
87
+ return True
88
+
89
  dataset = (
90
+ wds.WebDataset([str(f) for f in tar_files], shardshuffle=True, handler=ignore_errors)
91
  .shuffle(1000)
92
+ .decode("pil", handler=ignore_errors)
93
  .map(preprocess)
94
  .select(lambda x: x is not None)
95
  )