fix: new approach
Browse files- asr_dataset.py +4 -4
asr_dataset.py
CHANGED
@@ -113,12 +113,12 @@ class ASRDataset(datasets.GeneratorBasedBuilder):
|
|
113 |
inside_clips_dir = False
|
114 |
id_ = 0
|
115 |
for path, f in audio_files:
|
116 |
-
print('path: ', path)
|
117 |
if path.startswith(path_to_clips):
|
|
|
118 |
inside_clips_dir = True
|
119 |
-
if
|
120 |
-
audio = {"path":
|
121 |
-
yield id_, {**examples[
|
122 |
id_ += 1
|
123 |
elif inside_clips_dir:
|
124 |
break
|
|
|
113 |
inside_clips_dir = False
|
114 |
id_ = 0
|
115 |
for path, f in audio_files:
|
|
|
116 |
if path.startswith(path_to_clips):
|
117 |
+
audio_path2 = "/".join([path_to_clips, path])
|
118 |
inside_clips_dir = True
|
119 |
+
if audio_path2 in examples:
|
120 |
+
audio = {"path": audio_path2, "bytes": f.read()}
|
121 |
+
yield id_, {**examples[audio_path2], "audio": audio}
|
122 |
id_ += 1
|
123 |
elif inside_clips_dir:
|
124 |
break
|