Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,8 @@ def text2story(text):
|
|
30 |
Returns:
|
31 |
str: Generated story suitable for kids aged 3-10.
|
32 |
"""
|
33 |
-
#
|
34 |
-
prompt = f"Write a short, happy
|
35 |
|
36 |
text_generator = pipeline("text2text-generation", model="t5-small")
|
37 |
story = text_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
|
|
|
30 |
Returns:
|
31 |
str: Generated story suitable for kids aged 3-10.
|
32 |
"""
|
33 |
+
# Simplified and rephrased prompt to guide the model
|
34 |
+
prompt = f"Write a short, happy story for kids about {text}. The story should be cheerful, imaginative, and under 95 words."
|
35 |
|
36 |
text_generator = pipeline("text2text-generation", model="t5-small")
|
37 |
story = text_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
|