root commited on
Commit
1414401
·
1 Parent(s): 4bcaf2a
Files changed (1) hide show
  1. gigaspeech2_metadata.py +4 -1
gigaspeech2_metadata.py CHANGED
@@ -138,6 +138,8 @@ class Gigaspeech2(datasets.GeneratorBasedBuilder):
138
  for path, audio_f in tar_file:
139
  path = Path(path)
140
  utt_id = path.stem
 
 
141
  result = {
142
  'id': id_,
143
  'utt_id': utt_id,
@@ -148,9 +150,10 @@ class Gigaspeech2(datasets.GeneratorBasedBuilder):
148
  yield id_, result
149
  id_ += 1
150
  else:
151
- print(id2label)
152
  for audio_file in audio_archives:
153
  utt_id = Path(audio_file).stem
 
 
154
  result = {
155
  'id': id_,
156
  'utt_id': utt_id,
 
138
  for path, audio_f in tar_file:
139
  path = Path(path)
140
  utt_id = path.stem
141
+ if utt_id not in id2label:
142
+ continue
143
  result = {
144
  'id': id_,
145
  'utt_id': utt_id,
 
150
  yield id_, result
151
  id_ += 1
152
  else:
 
153
  for audio_file in audio_archives:
154
  utt_id = Path(audio_file).stem
155
+ if utt_id not in id2label:
156
+ continue
157
  result = {
158
  'id': id_,
159
  'utt_id': utt_id,