Set can_generate for SpeechT5ForTextToSpeech (#25493)

add can_generate=True to SpeechT5ForTextToSpeech
This commit is contained in:
Yoach Lacombe 2023-08-14 16:41:47 +02:00 committed by GitHub
parent 87c9d8a10f
commit ee7d6694ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2783,6 +2783,13 @@ class SpeechT5ForTextToSpeech(SpeechT5PreTrainedModel):
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()
def generate(
self,