mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 01:52:41 +00:00
Handle empty lattices in attention decoder rescoring.
This commit is contained in:
parent
8d679c3e74
commit
5b10310bd1
@ -856,6 +856,10 @@ def rescore_with_attention_decoder(
|
|||||||
tokens = tokens.remove_values_leq(0)
|
tokens = tokens.remove_values_leq(0)
|
||||||
token_ids = tokens.tolist()
|
token_ids = tokens.tolist()
|
||||||
|
|
||||||
|
if len(token_ids) == 0:
|
||||||
|
print("Warning: rescore_with_attention_decoder(): empty token-ids")
|
||||||
|
return None
|
||||||
|
|
||||||
nll = model.decoder_nll(
|
nll = model.decoder_nll(
|
||||||
memory=expanded_memory,
|
memory=expanded_memory,
|
||||||
memory_key_padding_mask=expanded_memory_key_padding_mask,
|
memory_key_padding_mask=expanded_memory_key_padding_mask,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user