Spaces:
Build error
Build error
Leo Liu commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,19 +17,8 @@ def text2story(text):
|
|
| 17 |
|
| 18 |
# text2audio
|
| 19 |
def text2audio(story_text):
|
| 20 |
-
pipe = pipeline(
|
| 21 |
-
|
| 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 |
|
|
|
|
| 17 |
|
| 18 |
# text2audio
|
| 19 |
def text2audio(story_text):
|
| 20 |
+
pipe = pipeline("text-to-audio", model="facebook/musicgen-small")
|
| 21 |
+
audio_data = pipe(story_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
return audio_data
|
| 23 |
|
| 24 |
|