Update app.py
Browse files
app.py
CHANGED
@@ -29,9 +29,12 @@ def generate_story(caption):
|
|
29 |
device=device_id
|
30 |
)
|
31 |
messages = (
|
32 |
-
|
33 |
-
|
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
|