Update app.py
Browse files
app.py
CHANGED
|
@@ -14,11 +14,10 @@ def img2text(img):
|
|
| 14 |
def text2story(text):
|
| 15 |
text_generation_model = pipeline("text-generation",
|
| 16 |
model="distilbert/distilgpt2")
|
| 17 |
-
story_text = text_generation_model
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
# text2audio
|
| 23 |
def text2audio(story_text):
|
| 24 |
text_to_speech_model = pipeline("text-to-speech", model="facebook/mms-tts-eng")
|
|
|
|
| 14 |
def text2story(text):
|
| 15 |
text_generation_model = pipeline("text-generation",
|
| 16 |
model="distilbert/distilgpt2")
|
| 17 |
+
story_text = text_generation_model + " Once upon a time, in a faraway land, there lived a magical creature. This creature had the power to..."
|
| 18 |
+
while len(story_text.split()) < 100:
|
| 19 |
+
story_text += " additional content to make the story longer."
|
| 20 |
+
|
|
|
|
| 21 |
# text2audio
|
| 22 |
def text2audio(story_text):
|
| 23 |
text_to_speech_model = pipeline("text-to-speech", model="facebook/mms-tts-eng")
|