Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def text2story(text):
|
|
48 |
story_generator = pipeline("text-generation", model="pranavpsv/gpt2-genre-story-generator")
|
49 |
|
50 |
# Generate the story with the superhero genre
|
51 |
-
prompt = f"<BOS> <superhero> {text}" # Add genre tags to the prompt
|
52 |
story = story_generator(prompt, max_length=150, num_return_sequences=1)[0]['generated_text']
|
53 |
|
54 |
# Remove <BOS> and <superhero> tags from the generated story
|
|
|
48 |
story_generator = pipeline("text-generation", model="pranavpsv/gpt2-genre-story-generator")
|
49 |
|
50 |
# Generate the story with the superhero genre
|
51 |
+
prompt = f"<BOS> <fun superhero> {text}" # Add genre tags to the prompt
|
52 |
story = story_generator(prompt, max_length=150, num_return_sequences=1)[0]['generated_text']
|
53 |
|
54 |
# Remove <BOS> and <superhero> tags from the generated story
|