Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,10 +59,12 @@ def generate_story(caption, model, tokenizer):
|
|
59 |
Returns:
|
60 |
story: Generated story as a string (100 words or less).
|
61 |
"""
|
62 |
-
# Add a child-friendly story prompt
|
63 |
story_prompt = (
|
64 |
f"Once upon a time, in a magical land, {caption}. "
|
65 |
"One sunny day, something magical happened! "
|
|
|
|
|
66 |
)
|
67 |
input_ids = tokenizer.encode(story_prompt, return_tensors="pt")
|
68 |
output = model.generate(
|
|
|
59 |
Returns:
|
60 |
story: Generated story as a string (100 words or less).
|
61 |
"""
|
62 |
+
# Add a child-friendly story prompt with clear instructions
|
63 |
story_prompt = (
|
64 |
f"Once upon a time, in a magical land, {caption}. "
|
65 |
"One sunny day, something magical happened! "
|
66 |
+
"The children were playing when they discovered something amazing. "
|
67 |
+
"Here is what happened next: "
|
68 |
)
|
69 |
input_ids = tokenizer.encode(story_prompt, return_tensors="pt")
|
70 |
output = model.generate(
|