Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,10 +37,10 @@ def text2story(text):
|
|
37 |
str: Generated superhero story suitable for kids aged 3-10, within 100 words.
|
38 |
"""
|
39 |
# Load the text generation model
|
40 |
-
story_generator = pipeline("text-generation", model="pranavpsv/genre-story-generator
|
41 |
|
42 |
# Generate the story with the superhero genre
|
43 |
-
prompt = f"{text}"
|
44 |
story = story_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
|
45 |
|
46 |
# Remove <BOS> and <superhero> tags from the generated story
|
|
|
37 |
str: Generated superhero story suitable for kids aged 3-10, within 100 words.
|
38 |
"""
|
39 |
# Load the text generation model
|
40 |
+
story_generator = pipeline("text-generation", model="pranavpsv/gpt2-genre-story-generator")
|
41 |
|
42 |
# Generate the story with the superhero genre
|
43 |
+
prompt = f"<BOS> <superhero> {text}"
|
44 |
story = story_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
|
45 |
|
46 |
# Remove <BOS> and <superhero> tags from the generated story
|