cdminix commited on
Commit
817571c
·
verified ·
1 Parent(s): acb867d

add retry hotfix

Browse files
Files changed (1) hide show
  1. libriheavy.py +8 -1
libriheavy.py CHANGED
@@ -204,7 +204,14 @@ class Libriheavy(datasets.GeneratorBasedBuilder):
204
  for chunk in speaker_chunks:
205
  if finish_stream:
206
  break
207
- npz = dict(np.load(chunk["audio"], allow_pickle=True))
 
 
 
 
 
 
 
208
  utterances = npz.keys()
209
  with gzip.open(chunk["text"], "rt") as f:
210
  text = json.load(f)
 
204
  for chunk in speaker_chunks:
205
  if finish_stream:
206
  break
207
+ retry = 0
208
+ while retry < 10:
209
+ try:
210
+ npz = dict(np.load(chunk["audio"], allow_pickle=True))
211
+ break
212
+ except error:
213
+ print(error, "retrying in 60s")
214
+ sleep(60)
215
  utterances = npz.keys()
216
  with gzip.open(chunk["text"], "rt") as f:
217
  text = json.load(f)