Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support batch-dimension in log_mel_spectogram #839

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

HennerM
Copy link
Contributor

@HennerM HennerM commented Jan 13, 2023

log_mel_spectrogram makes the assumption in stft[:, :-1].abs() ** 2 that the input to this function is one dimensional (sequence of audio samples in 16kHz).

However, all the tensor operating functions can deal with a leading batch dimensions. PyTorch supports the Ellipsis like NumPy to indicate remaining dimensions. This allows us to directly reference the last dimension, instead of assuming that the stft frames end up in the second dimension.

By using the ellipsis symbol on the stft tensor we can make log_mel_spectogram support batched inputs of shape [batch, samples].

@jongwook jongwook merged commit 6df3ea1 into openai:main Jan 17, 2023
zackees pushed a commit to zackees/whisper that referenced this pull request May 5, 2023
ilanit1997 pushed a commit to ilanit1997/whisper that referenced this pull request May 16, 2023
abyesilyurt pushed a commit to abyesilyurt/whisper that referenced this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants