add generate method to SpeechT5ForTextToSpeech (#25233)

* add generate method to SpeechT5ForTextToSpeech

* update speecht5forTTS docstrings

* Remove defaults to None in generate docstrings

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

---------

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Yoach Lacombe
2023-08-03 15:12:07 +02:00
committed by GitHub
parent 8455346c5c
commit 6d3f9c1e2e
3 changed files with 65 additions and 2 deletions

View File

@@ -1020,6 +1020,10 @@ class SpeechT5ForTextToSpeechIntegrationTests(unittest.TestCase):
generated_speech = model.generate_speech(input_ids)
self.assertEqual(generated_speech.shape, (1820, model.config.num_mel_bins))
# test model.generate, same method than generate_speech but with additional kwargs to absorb kwargs such as attention_mask
generated_speech_with_generate = model.generate(input_ids, attention_mask=None)
self.assertEqual(generated_speech_with_generate.shape, (1820, model.config.num_mel_bins))
@require_torch
class SpeechT5ForSpeechToSpeechTester: