Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,13 +12,13 @@ def img2text(url):
|
|
| 12 |
|
| 13 |
# text2story
|
| 14 |
def text2story(text):
|
| 15 |
-
pipe = pipeline("text-generation", model="
|
| 16 |
story_text = pipe(text, max_length=100)[0]['generated_text']
|
| 17 |
return story_text
|
| 18 |
|
| 19 |
# text2audio
|
| 20 |
def text2audio(story_text):
|
| 21 |
-
pipe = pipeline("text-to-speech", model="
|
| 22 |
audio_data = pipe(story_text)
|
| 23 |
return audio_data
|
| 24 |
|
|
|
|
| 12 |
|
| 13 |
# text2story
|
| 14 |
def text2story(text):
|
| 15 |
+
pipe = pipeline("text-generation", model="gpt2")
|
| 16 |
story_text = pipe(text, max_length=100)[0]['generated_text']
|
| 17 |
return story_text
|
| 18 |
|
| 19 |
# text2audio
|
| 20 |
def text2audio(story_text):
|
| 21 |
+
pipe = pipeline("text-to-speech", model="facebook/mms-tts-eng")
|
| 22 |
audio_data = pipe(story_text)
|
| 23 |
return audio_data
|
| 24 |
|