Update app.py
Browse files
app.py
CHANGED
@@ -20,13 +20,13 @@ def generate_caption(image_file):
|
|
20 |
def generate_story(caption):
|
21 |
story_generator = pipeline(
|
22 |
"text-generation",
|
23 |
-
model="Qwen/Qwen2-
|
24 |
)
|
25 |
prompt = (
|
26 |
-
"You are a
|
27 |
-
"Using the image details provided below, please
|
28 |
-
"Rather than simply
|
29 |
-
"and delightful surprises. Let your narrative flow naturally and
|
30 |
"Please ensure that your story is engaging, coherent, and falls between 100 and 300 words in length.\n\n"
|
31 |
f"Image Details: {caption}\n\nStory:"
|
32 |
)
|
|
|
20 |
def generate_story(caption):
|
21 |
story_generator = pipeline(
|
22 |
"text-generation",
|
23 |
+
model="Qwen/Qwen2.5-0.5B-Instruct",
|
24 |
)
|
25 |
prompt = (
|
26 |
+
"You are a highly imaginative children's story writer celebrated for your creativity and captivating narratives. "
|
27 |
+
"Using the image details provided below, please craft an enchanting tale tailored for children aged 3 to 10. "
|
28 |
+
"Rather than simply reiterating the image details, enhance your story with imaginative characters, quirky adventures, "
|
29 |
+
"and delightful surprises that ignite wonder in every young heart. Let your narrative flow naturally and kindle the magic of storytelling. "
|
30 |
"Please ensure that your story is engaging, coherent, and falls between 100 and 300 words in length.\n\n"
|
31 |
f"Image Details: {caption}\n\nStory:"
|
32 |
)
|