From 940aedf7ce493a1b5765ef9f57e75832cb67411a Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Thu, 11 Nov 2021 19:35:53 +0800 Subject: [PATCH] Minor fixes. --- egs/librispeech/ASR/conformer_ctc/decode.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/decode.py b/egs/librispeech/ASR/conformer_ctc/decode.py index 944ecbf98..4fd1ae388 100755 --- a/egs/librispeech/ASR/conformer_ctc/decode.py +++ b/egs/librispeech/ASR/conformer_ctc/decode.py @@ -479,14 +479,13 @@ def decode_dataset( assert ( len(results) > 0 ), "It should not decode to empty in the first batch!" - keys = list(results.keys()) - for lm_scale in keys: - this_batch = [] - hyp_words = [] - for ref_text in texts: - ref_words = ref_text.split() - this_batch.append((ref_words, hyp_words)) + this_batch = [] + hyp_words = [] + for ref_text in texts: + ref_words = ref_text.split() + this_batch.append((ref_words, hyp_words)) + for lm_scale in results.keys(): results[lm_scale].extend(this_batch) num_cuts += len(texts)