Update decode.py

fix bug ```TypeError: greedy_search_batch() missing 1 required positional argument: 'encoder_out_lens'```
This commit is contained in:
fanlu 2022-06-02 20:56:34 +08:00 committed by GitHub
parent fbfc98f1d3
commit ffdf161830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,6 +274,7 @@ def decode_one_batch(
hyp_tokens = greedy_search_batch(
model=model,
encoder_out=encoder_out,
encoder_out_lens=encoder_out_lens,
)
for i in range(encoder_out.size(0)):
hyps.append([lexicon.token_table[idx] for idx in hyp_tokens[i]])