{{ message }}
[higgs_audio_v2] Fix: use config.num_codebooks in audio labels tensor (Simple Fix!) - #48560
Open
b-re-w wants to merge 2 commits into
Open
[higgs_audio_v2] Fix: use config.num_codebooks in audio labels tensor (Simple Fix!)#48560b-re-w wants to merge 2 commits into
b-re-w wants to merge 2 commits into
Conversation
Fix - `HiggsAudioV2ForConditionalGeneration.forward` allocated the expanded audio label tensor with a hardcoded last dimension of 8.
Contributor
Contributor
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.

Hello, I'm a TTS researcher who heavily relies on transformers library for my research work.
Recently, I found a simple but somewhat critical bug for model researcher while I using Higgs Audio V2 model.
So, I'd like to report and PR this fix (without Issue).
Below is the content what I am reporting:
HiggsAudioV2ForConditionalGeneration.forwardallocated the expanded audio label tensor with a hardcoded last dimension of 8:while every surrounding computation is driven by
self.config.num_codebooks:audio_logitsis reshaped to(..., num_codebooks, codebook_size)and the per-codebook loss loop iterates overrange(self.config.num_codebooks).8is just the default ofHiggsAudioV2Config.num_codebooks, so the two only agree by coincidence. With any other value the next line fails to broadcast:This happens for any
num_codebooks != 8, smaller or larger, the loss loop is never reached.Replace the literal with
self.config.num_codebooks.Applied to
modular_higgs_audio_v2.pyand regenerated intomodeling_higgs_audio_v2.py.audio_labelsis not passed anywhere intests/, so this branch was dead code in CI. I addedtest_forward_with_audio_labels; the tester already usesnum_codebooks=2, so it fails on the current code and passes with the fix.What does this PR do?
Code Agent Policy
Before submitting
Pull Request checks?
to it if that's the case.
Who can review?
Models: