pytorch / pytorch/audio

Using MMS model with `star` token for batch size > 1

Open Beginner friendly
#3,772 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.