Update app.py
Browse files
app.py
CHANGED
@@ -53,12 +53,7 @@ def generate_story(caption: str) -> str:
|
|
53 |
prompt = (
|
54 |
"You are a creative children’s-story author.\n"
|
55 |
f"Image description: “{caption}”\n\n"
|
56 |
-
"Write a coherent 50–100 word story
|
57 |
-
"1. Introduces the main character.\n"
|
58 |
-
"2. Shows a simple problem or discovery.\n"
|
59 |
-
"3. Has a happy resolution.\n"
|
60 |
-
"4. Uses clear language for ages 3–8.\n"
|
61 |
-
"5. Keeps each sentence under 20 words.\n"
|
62 |
)
|
63 |
t0 = time.time()
|
64 |
out = storyteller(prompt, max_new_tokens=120, temperature=0.7, top_p=0.9)[0]["generated_text"]
|
|
|
53 |
prompt = (
|
54 |
"You are a creative children’s-story author.\n"
|
55 |
f"Image description: “{caption}”\n\n"
|
56 |
+
"Write a coherent 50–100 word story\n"
|
|
|
|
|
|
|
|
|
|
|
57 |
)
|
58 |
t0 = time.time()
|
59 |
out = storyteller(prompt, max_new_tokens=120, temperature=0.7, top_p=0.9)[0]["generated_text"]
|