Skip to content

Commit 8c776b8

Browse files
committed
added fix for lhotse unique cut IDs, WER regression with batch_size increase
1 parent 50aab94 commit 8c776b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nemo_asr/run_eval.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ def download_audio_files(batch):
5252
durations = []
5353

5454
for id, sample in zip(batch["id"], batch["audio"]):
55+
56+
# frist step added here to make ID and wav filenames unique
57+
# several datasets like earnings22 have a hierarchical structure
58+
# for eg. earnings22/test/4432298/281.wav, earnings22/test/4450488/281.wav
59+
# lhotse uses the filename (281.wav) here as unique ID to create and name cuts
60+
# ref: https://github.com/lhotse-speech/lhotse/blob/master/lhotse/dataset/collation.py#L186
61+
id = id.replace('/', '_').removesuffix('.wav')
62+
5563
audio_path = os.path.join(CACHE_DIR, f"{id}.wav")
5664

5765
if "array" in sample:

0 commit comments

Comments
 (0)