ganeshkamath89 commited on
Commit
c805802
·
verified ·
1 Parent(s): f2d23e7

changing greet() to generate_story() function

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,10 +1,12 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello, " + name + "!"
 
 
5
 
6
  demo = gr.Interface (
7
- fn=greet,
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")],