Leo Liu commited on
Commit
f77ca14
·
verified ·
1 Parent(s): f02966b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -14,12 +14,12 @@ def text2story(text):
14
  story_prompt = (
15
  f"You are an expert in storytelling for children ages 3-10."
16
  f"Based on the image description below:{text}\n"
17
- f"Please create a funny, heartwarming, imaginative fairy tale of no less than 50 words"
18
- f"Output only the body of the story, do not include other content"
19
  )
20
 
21
- story_text = pipeline("text-generation", model="distilbert/distilgpt2",
22
- max_length=200,
23
  do_sample=True,
24
  top_p=0.95,
25
  temperature=0.7)
 
14
  story_prompt = (
15
  f"You are an expert in storytelling for children ages 3-10."
16
  f"Based on the image description below:{text}\n"
17
+ f"Please create a funny, heartwarming, imaginative fairy tale of no less than 50 words and less than 100 words."
18
+ f"Output only the body of the story, do not include other content."
19
  )
20
 
21
+ story_text = pipeline("text-generation", model="distilgpt2",
22
+ max_length=100,
23
  do_sample=True,
24
  top_p=0.95,
25
  temperature=0.7)