Spaces:
Sleeping
Sleeping
TomMoule91
commited on
Commit
•
7a9fcac
1
Parent(s):
ec3b425
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,6 @@ generator = pipeline("text-generation")
|
|
6 |
|
7 |
def generate_bedtime_story(name, interests, friends, age):
|
8 |
story_prompt = f"I want to tell a bed time story to a child named {name}. I want the story to revolve around some of {name}'s main interests, which are {interests}. I also want the story to include some of {name}'s friends, who are called: {friends}. Make sure the story is suitable for a child of the age {age}."
|
9 |
-
|
10 |
-
|
11 |
-
Once upon a time, there was a child named {name}. {name} loved {', '.join(interests)} and had many friends including {', '.join(friends)}."
|
12 |
story = generator(story_prompt, max_length=1000)[0]['generated_text']
|
13 |
return story
|
14 |
|
|
|
6 |
|
7 |
def generate_bedtime_story(name, interests, friends, age):
|
8 |
story_prompt = f"I want to tell a bed time story to a child named {name}. I want the story to revolve around some of {name}'s main interests, which are {interests}. I also want the story to include some of {name}'s friends, who are called: {friends}. Make sure the story is suitable for a child of the age {age}."
|
|
|
|
|
|
|
9 |
story = generator(story_prompt, max_length=1000)[0]['generated_text']
|
10 |
return story
|
11 |
|