FunASR model bugfix (#36633)
Signed-off-by: zixiao <shunli.dsl@alibaba-inc.com> Co-authored-by: zixiao <shunli.dsl@alibaba-inc.com>
This commit is contained in:
@@ -573,6 +573,8 @@ class Transformer(nn.Module):
|
||||
)
|
||||
|
||||
def forward(self, hidden_states: torch.Tensor, ilens: int = 0):
|
||||
max_len = max(ilens)
|
||||
hidden_states = hidden_states[:, :max_len, :]
|
||||
batch_size, seq_len, dim = hidden_states.size()
|
||||
chunk_num = (seq_len - 1) // self.k + 1
|
||||
pad_num = chunk_num * self.k - seq_len
|
||||
|
||||
Reference in New Issue
Block a user