From c026a97d4187dbdac0a528c876ee47564bb2ec13 Mon Sep 17 00:00:00 2001 From: Guo Liyong Date: Fri, 29 Apr 2022 11:57:51 +0800 Subject: [PATCH] check codebook index range before saving --- .../vq_pruned_transducer_stateless2/hubert_code_indices.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/vq_pruned_transducer_stateless2/hubert_code_indices.py b/egs/librispeech/ASR/vq_pruned_transducer_stateless2/hubert_code_indices.py index 2af976c86..83c314241 100755 --- a/egs/librispeech/ASR/vq_pruned_transducer_stateless2/hubert_code_indices.py +++ b/egs/librispeech/ASR/vq_pruned_transducer_stateless2/hubert_code_indices.py @@ -92,9 +92,7 @@ def compute_codeindices( # [N, T, C] codebook_indices = codebook_indices.to("cpu").numpy() - assert np.all( - codebook_indices[np.where(codebook_indices < 0)] == -100 - ) + assert np.min(codebook_indices) >= 0 assert np.max(codebook_indices) < 256 supervisions = batch["supervisions"]