Fixes in '_generate_examples' function

#14
Files changed (1) hide show
  1. common_voice_11_0.py +2 -2
common_voice_11_0.py CHANGED
@@ -173,8 +173,8 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
173
  with open(meta_path, encoding="utf-8") as f:
174
  reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
175
  for row in tqdm(reader, desc="Reading metadata..."):
176
- if not row["path"].endswith(".mp3"):
177
- row["path"] += ".mp3"
178
  # accent -> accents in CV 8.0
179
  if "accents" in row:
180
  row["accent"] = row["accents"]
 
173
  with open(meta_path, encoding="utf-8") as f:
174
  reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
175
  for row in tqdm(reader, desc="Reading metadata..."):
176
+ if not row["path"].endswith(".wav"):
177
+ row["path"] += ".wav"
178
  # accent -> accents in CV 8.0
179
  if "accents" in row:
180
  row["accent"] = row["accents"]