BrunoHays commited on
Commit
9517968
1 Parent(s): de8132f

Update multilingual-TEDX-fr.py

Browse files
Files changed (1) hide show
  1. multilingual-TEDX-fr.py +2 -2
multilingual-TEDX-fr.py CHANGED
@@ -167,7 +167,7 @@ class TEDX(datasets.GeneratorBasedBuilder):
167
  utterances = iter(utterances)
168
  if self.config.single_samples:
169
  yield from utterances
170
- raise StopIteration
171
  merged_utterance = next(utterances)
172
  start_time = merged_utterance.start_timestamp
173
  while True:
@@ -175,7 +175,7 @@ class TEDX(datasets.GeneratorBasedBuilder):
175
  new_utterance = next(utterances)
176
  except StopIteration:
177
  yield merged_utterance
178
- raise StopIteration
179
  end_time = new_utterance.end_timestamp
180
  if end_time - start_time > self.config.max_duration:
181
  yield merged_utterance
 
167
  utterances = iter(utterances)
168
  if self.config.single_samples:
169
  yield from utterances
170
+ return
171
  merged_utterance = next(utterances)
172
  start_time = merged_utterance.start_timestamp
173
  while True:
 
175
  new_utterance = next(utterances)
176
  except StopIteration:
177
  yield merged_utterance
178
+ return
179
  end_time = new_utterance.end_timestamp
180
  if end_time - start_time > self.config.max_duration:
181
  yield merged_utterance