Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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"
|
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
|