Leo Liu commited on
Commit
94fbe83
·
verified ·
1 Parent(s): 08832c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -17,8 +17,19 @@ def text2story(text):
17
 
18
  # text2audio
19
  def text2audio(story_text):
20
- pipe = pipeline("text-to-audio", model="facebook/mms-tts-eng")
21
- audio_data = pipe(story_text)
 
 
 
 
 
 
 
 
 
 
 
22
  return audio_data
23
 
24
 
 
17
 
18
  # text2audio
19
  def text2audio(story_text):
20
+ pipe = pipeline(
21
+ "text-to-speech",
22
+ model="Matthijs/speecht5-tts",
23
+ speaker_id=10
24
+ )
25
+ audio_data = pipe(
26
+ story_text,
27
+ forward_params={
28
+ "speaker_embeddings": pipe.model.speaker_manager.speaker_ids[10],
29
+ "speed": 0.9,
30
+ "pitch": 2.0
31
+ }
32
+ )
33
  return audio_data
34
 
35