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
ee7d6694
Unverified
Commit
ee7d6694
authored
Aug 14, 2023
by
Yoach Lacombe
Committed by
GitHub
Aug 14, 2023
Browse files
Set can_generate for SpeechT5ForTextToSpeech (#25493)
add can_generate=True to SpeechT5ForTextToSpeech
parent
87c9d8a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/transformers/models/speecht5/modeling_speecht5.py
src/transformers/models/speecht5/modeling_speecht5.py
+7
-0
No files found.
src/transformers/models/speecht5/modeling_speecht5.py
View file @
ee7d6694
...
@@ -2783,6 +2783,13 @@ class SpeechT5ForTextToSpeech(SpeechT5PreTrainedModel):
...
@@ -2783,6 +2783,13 @@ class SpeechT5ForTextToSpeech(SpeechT5PreTrainedModel):
encoder_attentions
=
outputs
.
encoder_attentions
,
encoder_attentions
=
outputs
.
encoder_attentions
,
)
)
def
can_generate
(
self
)
->
bool
:
"""
Returns True. This model can `generate` and must therefore have this property set to True in order to be used
in the TTS pipeline.
"""
return
True
@
torch
.
no_grad
()
@
torch
.
no_grad
()
def
generate
(
def
generate
(
self
,
self
,
...
...
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