Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
2c658b5a
Unverified
Commit
2c658b5a
authored
Dec 01, 2023
by
Sanchit Gandhi
Committed by
GitHub
Dec 01, 2023
Browse files
[MusicGen] Fix audio channel attribute (#27440)
[MusicGen] Fix mono logit test
parent
abd4cbd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/musicgen/modeling_musicgen.py
src/transformers/models/musicgen/modeling_musicgen.py
+1
-1
No files found.
src/transformers/models/musicgen/modeling_musicgen.py
View file @
2c658b5a
...
@@ -1869,7 +1869,7 @@ class MusicgenForConditionalGeneration(PreTrainedModel):
...
@@ -1869,7 +1869,7 @@ class MusicgenForConditionalGeneration(PreTrainedModel):
"disabled by setting `chunk_length=None` in the audio encoder."
"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
# mono input through encodec that we convert to stereo
audio_codes
=
audio_codes
.
repeat_interleave
(
2
,
dim
=
2
)
audio_codes
=
audio_codes
.
repeat_interleave
(
2
,
dim
=
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment