Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
914771cb
Unverified
Commit
914771cb
authored
Sep 22, 2023
by
Sanchit Gandhi
Committed by
GitHub
Sep 22, 2023
Browse files
[TTA Pipeline] Fix MusicGen test (#26348)
* fix musicgen pipeline test * fix wav2vec2 doctest * revert wav2vec2
parent
368a58e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/pipelines/text_to_audio.py
src/transformers/pipelines/text_to_audio.py
+2
-2
No files found.
src/transformers/pipelines/text_to_audio.py
View file @
914771cb
...
@@ -71,13 +71,13 @@ class TextToAudioPipeline(Pipeline):
...
@@ -71,13 +71,13 @@ class TextToAudioPipeline(Pipeline):
if
self
.
sampling_rate
is
None
:
if
self
.
sampling_rate
is
None
:
# get sampling_rate from config and generation config
# get sampling_rate from config and generation config
config
=
self
.
model
.
config
.
to_dict
()
config
=
self
.
model
.
config
gen_config
=
self
.
model
.
__dict__
.
get
(
"generation_config"
,
None
)
gen_config
=
self
.
model
.
__dict__
.
get
(
"generation_config"
,
None
)
if
gen_config
is
not
None
:
if
gen_config
is
not
None
:
config
.
update
(
gen_config
.
to_dict
())
config
.
update
(
gen_config
.
to_dict
())
for
sampling_rate_name
in
[
"sample_rate"
,
"sampling_rate"
]:
for
sampling_rate_name
in
[
"sample_rate"
,
"sampling_rate"
]:
sampling_rate
=
config
.
get
(
sampling_rate_name
,
None
)
sampling_rate
=
getattr
(
config
,
sampling_rate_name
,
None
)
if
sampling_rate
is
not
None
:
if
sampling_rate
is
not
None
:
self
.
sampling_rate
=
sampling_rate
self
.
sampling_rate
=
sampling_rate
...
...
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