Datasets:
Fix for audio files without transcript
Browse files- tv3_parla.py +2 -0
tv3_parla.py
CHANGED
@@ -104,6 +104,8 @@ class Tv3Parla(datasets.GeneratorBasedBuilder):
|
|
104 |
for key, (path, file) in enumerate(audio_files):
|
105 |
if path.endswith(".wav") and f"/{split}/" in path:
|
106 |
uid = path.split("/")[-1][:-4]
|
|
|
|
|
107 |
text = transcripts.pop(uid)
|
108 |
audio = {"path": path, "bytes": file.read()}
|
109 |
yield key, {"path": path, "audio": audio, "text": text}
|
|
|
104 |
for key, (path, file) in enumerate(audio_files):
|
105 |
if path.endswith(".wav") and f"/{split}/" in path:
|
106 |
uid = path.split("/")[-1][:-4]
|
107 |
+
if uid not in transcripts:
|
108 |
+
continue
|
109 |
text = transcripts.pop(uid)
|
110 |
audio = {"path": path, "bytes": file.read()}
|
111 |
yield key, {"path": path, "audio": audio, "text": text}
|