xieqilenb commited on
Commit
c819855
·
verified ·
1 Parent(s): 6c8ca8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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-1.5B",
24
  )
25
  prompt = (
26
- "You are a talented children's story writer renowned for your creativity and captivating narratives. "
27
- "Using the image details provided below, please compose an enchanting tale tailored for children aged 3 to 10. "
28
- "Rather than simply rephrasing the image details, enrich your story with imaginative characters, quirky adventures, "
29
- "and delightful surprises. Let your narrative flow naturally and spark wonder in your young audience. "
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
  )