Leo Liu commited on
Commit
2ce596e
·
verified ·
1 Parent(s): d3f5d34

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=1086
24
+ )
25
+ audio_data = pipe(
26
+ story_text,
27
+ forward_params={
28
+ "speaker_embeddings": pipe.model.speaker_manager.speaker_ids[1086],
29
+ "pitch": 5.0,
30
+ "speed": 0.85
31
+ }
32
+ )
33
  return audio_data
34
 
35