xieqilenb commited on
Commit
517a9fc
·
verified ·
1 Parent(s): 0ef8c0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -29,9 +29,12 @@ def generate_story(caption):
29
  device=device_id
30
  )
31
  messages = (
32
- "Please based on following image caption: " + caption +
33
- ", generate a complete fairy tale story for children with at least 100 words and max 300 words"
34
- )
 
 
 
35
  result = story_generator(messages, max_length=300, num_return_sequences=1)
36
  story = result[0]['generated_text']
37
  return story
 
29
  device=device_id
30
  )
31
  messages = (
32
+ "You are a creative children's story writer. Based on the following image details, "
33
+ "please write an imaginative story for children aged 3-10. Do not simply rephrase the image details; "
34
+ "instead, expand creatively by adding fun characters, adventures, and unexpected twists. "
35
+ "The story must be at least 100 words long.\n\n"
36
+ f"Image Details: {caption}\n\nStory:"
37
+ )
38
  result = story_generator(messages, max_length=300, num_return_sequences=1)
39
  story = result[0]['generated_text']
40
  return story