Commit
·
0f85fc2
1
Parent(s):
fa0452d
Update asr-sample.py
Browse files- asr-sample.py +3 -1
asr-sample.py
CHANGED
|
@@ -130,6 +130,7 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
| 130 |
if path.endswith(".flac"):
|
| 131 |
id_ = path.split("/")[-1][: -len(".flac")]
|
| 132 |
audio_data[id_] = f.read()
|
|
|
|
| 133 |
elif path.endswith(".trans.txt"):
|
| 134 |
for line in f:
|
| 135 |
if line:
|
|
@@ -154,7 +155,8 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
| 154 |
if audio_data and len(audio_data) == len(transcripts):
|
| 155 |
for transcript in transcripts:
|
| 156 |
audio = {"path": transcript["file"], "bytes": audio_data[transcript["id"]]}
|
| 157 |
-
|
|
|
|
| 158 |
key += 1
|
| 159 |
audio_data = {}
|
| 160 |
transcripts = []
|
|
|
|
| 130 |
if path.endswith(".flac"):
|
| 131 |
id_ = path.split("/")[-1][: -len(".flac")]
|
| 132 |
audio_data[id_] = f.read()
|
| 133 |
+
#print(audio_data[id_])
|
| 134 |
elif path.endswith(".trans.txt"):
|
| 135 |
for line in f:
|
| 136 |
if line:
|
|
|
|
| 155 |
if audio_data and len(audio_data) == len(transcripts):
|
| 156 |
for transcript in transcripts:
|
| 157 |
audio = {"path": transcript["file"], "bytes": audio_data[transcript["id"]]}
|
| 158 |
+
print('aud.....',audio_data[transcript["id"]])
|
| 159 |
+
yield key, {"audio": audio2, **transcript}
|
| 160 |
key += 1
|
| 161 |
audio_data = {}
|
| 162 |
transcripts = []
|