fyyb commited on
Commit
7ebe1af
·
verified ·
1 Parent(s): 03fb058

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -18,8 +18,12 @@ def text2story(text):
18
 
19
  # text2audio
20
  def text2audio(story_text):
21
- audio_data = pipeline("text-to-speech", model="suno/bark-small")
22
- return audio_data
 
 
 
 
23
 
24
  #main part
25
 
 
18
 
19
  # text2audio
20
  def text2audio(story_text):
21
+ text_to_speech_model = pipeline("text-to-speech", model="suno/bark-small")
22
+ audio_data = text_to_speech_model(story_text)
23
+ return {
24
+ 'audio': audio_data[0]['audio'],
25
+ 'sampling_rate': audio_data[0]['sampling_rate']
26
+ }
27
 
28
  #main part
29