Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def generate_caption(image):
|
|
26 |
|
27 |
def generate_story(caption):
|
28 |
# Generate the story based on the caption using the GPT-2 model
|
29 |
-
prompt = f"
|
30 |
story = story_generator(prompt, max_length=500, num_return_sequences=1)[0]["generated_text"]
|
31 |
|
32 |
# Extract the story text from the generated output
|
|
|
26 |
|
27 |
def generate_story(caption):
|
28 |
# Generate the story based on the caption using the GPT-2 model
|
29 |
+
prompt = f"Imagine a delightful children's fairy tale inspired by the image described as '{caption}'. Itnshould be interesting, easy to understand, and use age-appropriate language suitable for children aged 3-10. Let the magical story unfold:\n\n"
|
30 |
story = story_generator(prompt, max_length=500, num_return_sequences=1)[0]["generated_text"]
|
31 |
|
32 |
# Extract the story text from the generated output
|