[MusicGen] Fix audio channel attribute (#27440)

[MusicGen] Fix mono logit test
This commit is contained in:
Sanchit Gandhi 2023-12-01 17:10:03 +00:00 committed by GitHub
parent abd4cbd775
commit 2c658b5a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1869,7 +1869,7 @@ class MusicgenForConditionalGeneration(PreTrainedModel):
"disabled by setting `chunk_length=None` in the audio encoder."
)
if self.config.audio_channels == 2 and audio_codes.shape[2] == self.decoder.num_codebooks // 2:
if self.config.decoder.audio_channels == 2 and audio_codes.shape[2] == self.decoder.num_codebooks // 2:
# mono input through encodec that we convert to stereo
audio_codes = audio_codes.repeat_interleave(2, dim=2)