Spaces:
Build error
Build error
Leo Liu commited on
Update app.py
Browse files
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="
|
| 22 |
-
max_length=
|
| 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)
|