Skip to content

Commit

Permalink
fix: fixing batching in MMS_FA
Browse files Browse the repository at this point in the history
  • Loading branch information
ex3ndr authored Nov 21, 2024
1 parent 332760d commit a6bbeaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchaudio/pipelines/_wav2vec2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def forward(self, waveforms: Tensor, lengths: Optional[Tensor] = None) -> Tuple[
if self.apply_log_softmax:
output = torch.nn.functional.log_softmax(output, dim=-1)
if self.append_star:
star_dim = torch.zeros((1, output.size(1), 1), dtype=output.dtype, device=output.device)
star_dim = torch.zeros((output.size(0), output.size(1), 1), dtype=output.dtype, device=output.device)
output = torch.cat((output, star_dim), dim=-1)
return output, output_lengths

Expand Down

0 comments on commit a6bbeaf

Please sign in to comment.