minor fix

This commit is contained in:
yaozengwei 2022-05-12 17:14:04 +08:00
parent 61ecd3764d
commit 6a7b69168c
2 changed files with 3 additions and 2 deletions

View File

@ -480,6 +480,7 @@ def main():
# <blk> is defined in local/train_bpe_model.py
params.blank_id = sp.piece_to_id("<blk>")
params.unk_id = sp.piece_to_id("<unk>")
params.vocab_size = sp.get_piece_size()
logging.info(params)

View File

@ -729,7 +729,7 @@ class EmformerLayer(nn.Module):
lengths: torch.Tensor,
memory: torch.Tensor,
pos_emb: torch.Tensor,
attention_mask: Optional[torch.Tensor],
attention_mask: Optional[torch.Tensor] = None,
) -> Tuple[torch.Tensor, torch.Tensor]:
"""Apply attention module in non-infer mode."""
if attention_mask is None:
@ -897,8 +897,8 @@ class EmformerLayer(nn.Module):
right_context_end_idx,
lengths,
memory,
attention_mask,
pos_emb,
attention_mask,
)
right_context_utterance = self._apply_conv_module_forward(