mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-08 09:32:20 +00:00
Merge pull request #117 from csukuangfj/fix-empty-lattice
Handle empty lattices in attention decoder rescoring.
This commit is contained in:
commit
b9452235d5
@ -856,6 +856,10 @@ def rescore_with_attention_decoder(
|
||||
tokens = tokens.remove_values_leq(0)
|
||||
token_ids = tokens.tolist()
|
||||
|
||||
if len(token_ids) == 0:
|
||||
print("Warning: rescore_with_attention_decoder(): empty token-ids")
|
||||
return None
|
||||
|
||||
nll = model.decoder_nll(
|
||||
memory=expanded_memory,
|
||||
memory_key_padding_mask=expanded_memory_key_padding_mask,
|
||||
|
Loading…
x
Reference in New Issue
Block a user