EmmaL1 commited on
Commit
733173b
·
verified ·
1 Parent(s): 785d504

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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("Once upon a time in a land far, far away",
18
- max_length=100,
19
- num_return_sequences=1)
20
- return story_text
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")