Spaces:
Sleeping
Sleeping
kidsampson
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ pipe = pipeline("text-generation", model="openai-community/gpt2")
|
|
18 |
|
19 |
def response(age, story):
|
20 |
#messages = f"this is the 300 word story of {story} in words a {age} year old can understand."
|
21 |
-
messages = f"
|
22 |
sequences = pipe(messages, max_length=500)
|
23 |
gen_text = sequences[0]["generated_text"][len(messages):]
|
24 |
return gen_text
|
|
|
18 |
|
19 |
def response(age, story):
|
20 |
#messages = f"this is the 300 word story of {story} in words a {age} year old can understand."
|
21 |
+
messages = f"You are a school teacher telling stories to children. Retell the story of {story} in 300 words using language a {age} year old can understand."
|
22 |
sequences = pipe(messages, max_length=500)
|
23 |
gen_text = sequences[0]["generated_text"][len(messages):]
|
24 |
return gen_text
|