Using MMS model with `star` token for batch size > 1
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 799
- Avg merge
- 58m
- Merged PRs (30d)
- 3
Description
The current implementation assumes batch size is one, when attaching the star dimension:
https://github.com/pytorch/audio/blob/ea437b31ce316ea3d66fe73768c0dcb94edb79ad/src/torchaudio/pipelines/_wav2vec2/utils.py#L41
However, the underlying Wav2vec model supports batch size greater than one. So this line should instead be:
star_dim = torch.zeros((output.size(0), output.size(1), 1), dtype=output.dtype, device=output.device)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/torchaudio/pipelines/_wav2vec2/utils.py at the linked line where the star dimension is attached. Check how the output shape is formed for batch size greater than one, then verify that the star dimension preserves the batch and sequence dimensions and that MMS processing works for batched input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100