koey811 commited on
Commit
4064d7b
·
verified ·
1 Parent(s): f8a61d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -28,7 +28,7 @@ def generate_caption(image):
28
 
29
  def generate_story(caption):
30
  # Generate the story based on the caption using the GPT-2 model
31
- prompt = f"Imagine a children's fairy tale inspired by the image described as '{caption}'. The story should be suitable for children aged 3-10. Story should be in max 100 words"
32
  story = story_generator(prompt, max_length=500, num_return_sequences=1)[0]["generated_text"]
33
 
34
  # Extract the story text from the generated output
 
28
 
29
  def generate_story(caption):
30
  # Generate the story based on the caption using the GPT-2 model
31
+ prompt = f"Once upon a time, in a world inspired by the image described as '{caption}', a delightful fairy tale unfolded. The story, suitable for children aged 3-10, goes like this:\n\n"
32
  story = story_generator(prompt, max_length=500, num_return_sequences=1)[0]["generated_text"]
33
 
34
  # Extract the story text from the generated output