Spaces:
Runtime error
Runtime error
Adding more examples for story generation themes
Browse files
app.py
CHANGED
@@ -4,12 +4,16 @@ from transformers import pipeline
|
|
4 |
def generate_story(story):
|
5 |
story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
|
6 |
story_expanded = story_gen(story)
|
7 |
-
return story_expanded
|
8 |
|
9 |
demo = gr.Interface (
|
10 |
fn=generate_story,
|
11 |
description="Story generation with GPT-2",
|
12 |
-
examples=[
|
|
|
|
|
|
|
|
|
13 |
inputs=[gr.Textbox(lines=7, label="Story URL")],
|
14 |
outputs=[gr.Textbox(lines=7, label="Story Summary")]
|
15 |
)
|
|
|
4 |
def generate_story(story):
|
5 |
story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
|
6 |
story_expanded = story_gen(story)
|
7 |
+
return story_expanded['generated_text']
|
8 |
|
9 |
demo = gr.Interface (
|
10 |
fn=generate_story,
|
11 |
description="Story generation with GPT-2",
|
12 |
+
examples=[
|
13 |
+
["Adventurer is approached by a mysterious stranger in the tavern for a new quest."],
|
14 |
+
["He didn't remember the last time he had to run this fast as he jumped on to the bus."],
|
15 |
+
["Fate has it's own plans for the common man, which is why we philosophise on "]
|
16 |
+
],
|
17 |
inputs=[gr.Textbox(lines=7, label="Story URL")],
|
18 |
outputs=[gr.Textbox(lines=7, label="Story Summary")]
|
19 |
)
|