Spaces:
Sleeping
Sleeping
changing greet() to generate_story() function
Browse files
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
5 |
|
6 |
demo = gr.Interface (
|
7 |
-
fn=
|
8 |
description="Story generation with GPT-2",
|
9 |
examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]],
|
10 |
inputs=[gr.Textbox(lines=7, label="Story URL")],
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def generate_story(story):
|
4 |
+
story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
|
5 |
+
story_expanded = story_gen(story)
|
6 |
+
return story_expanded
|
7 |
|
8 |
demo = gr.Interface (
|
9 |
+
fn=generate_story,
|
10 |
description="Story generation with GPT-2",
|
11 |
examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]],
|
12 |
inputs=[gr.Textbox(lines=7, label="Story URL")],
|