Fix mel length computation in Qwen2-Audio#42098
Open
anferico wants to merge 1 commit intohuggingface:mainfrom
Open
Fix mel length computation in Qwen2-Audio#42098anferico wants to merge 1 commit intohuggingface:mainfrom
anferico wants to merge 1 commit intohuggingface:mainfrom
Conversation
6646ff2 to
e55fff6
Compare
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: qwen2_audio |
Contributor
Author
|
@ylacombe @amyeroberts @faychu any news? |
Member
This was referenced Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Qwen2AudioEncoder.forwardstating that "Qwen2Audio does not support masking of theinput_features", while in fact it does make use of it. This is likely a mistake made while copying the docstring over from Whispermax_mel_seq_lenis an odd numberHere's a more elaborate explanation for point 2:
max_seq_lenrepresents the maximum sequence length after the first 2 convolutional layers, of which only the first one compresses the input sequences (due tostride=2). The compression applied by the first convolutional layer can be computed using this expression (cf. torch.nn.Conv1d):which, given that:
padding= 1dilation= 1kernel_size= 3stride= 2can be simplified to:
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@ylacombe @amyeroberts @faychu