Skip to content

Commit

Permalink
[MusicGen] Fix audio channel attribute (#27440)
Browse files Browse the repository at this point in the history
[MusicGen] Fix mono logit test
  • Loading branch information
sanchit-gandhi authored Dec 1, 2023
1 parent abd4cbd commit 2c658b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/musicgen/modeling_musicgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ def forward(
"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)

Expand Down

0 comments on commit 2c658b5

Please sign in to comment.