From 73f1267ec071d0f07c308997d49105f4b66f6bea Mon Sep 17 00:00:00 2001 From: Anna P Date: Sun, 28 Jul 2024 09:41:58 +0800 Subject: [PATCH] fix model encoder to use a different model than the default --- examples/libriheavy/tools/recognize.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/libriheavy/tools/recognize.py b/examples/libriheavy/tools/recognize.py index b845f7d..9fa140d 100755 --- a/examples/libriheavy/tools/recognize.py +++ b/examples/libriheavy/tools/recognize.py @@ -181,10 +181,13 @@ def decode_one_batch( supervisions = batch["supervisions"] feature_lens = supervisions["num_frames"].to(device) - encoder_out, encoder_out_lens = model.encoder( - features=feature, - feature_lengths=feature_lens, - ) + #encoder_out, encoder_out_lens = model.encoder( + # features=feature, + # feature_lengths=feature_lens, + #) + + # to use a different model than the default this fix is needed + encoder_out, encoder_out_lens = model.encoder(feature,feature_lens,) if params.decoding_method == "greedy_search": res = greedy_search_batch(