Update frame_reducer.py

Fix mistake
This commit is contained in:
drawfish 2023-05-23 11:51:41 +08:00 committed by GitHub
parent e4b82da41c
commit 63c7402297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,7 @@ class FrameReducer(nn.Module):
limit_lens = T - y_lens limit_lens = T - y_lens
else: else:
# In eval mode, ensure audio that is completely silent does not make any errors # In eval mode, ensure audio that is completely silent does not make any errors
limit_lens = torch.ones_like(x_lens) limit_lens = T - torch.ones_like(x_lens)
max_limit_len = limit_lens.max().int() max_limit_len = limit_lens.max().int()
fake_limit_indexes = torch.topk( fake_limit_indexes = torch.topk(
ctc_output[:, :, blank_id], max_limit_len ctc_output[:, :, blank_id], max_limit_len