From 9a7979d7b86b3571707f14d9cedb5815f6abfe17 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Sat, 29 Oct 2022 20:03:41 +0800 Subject: [PATCH] Avoid falling off the loop for weird inputs --- egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py index 1d2b1f279..706d9ffa2 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py @@ -155,7 +155,7 @@ class Zipformer(EncoderInterface): else: # TEMP for j in range(i-2, -1, -1): - if z[j] <= z[i]: + if z[j] <= z[i] or j == 0: # TEMP logging statement. logging.info(f"At encoder stack {i}, which has downsampling_factor={z[i]}, we will " f"combine the outputs of layers {j} and {i-1}, with downsampling_factors={z[j]} and {z[i-1]}.")