ganeshkamath89 commited on
Commit
1cfb225
·
verified ·
1 Parent(s): 67551e6

Experimenting with gr.inputs.Textbox for outputs

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -4,5 +4,12 @@ def generate_story(story):
4
  story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
5
  generated_story = story_gen("<BOS> <superhero> Batman")
6
  return generated_story
7
- interface = gr.Interface(fn=generate_story, title="Story Generation with GPT-2", inputs=[gr.Textbox(lines=7, label="Story")], description="Story generation with GPT-2", examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]], outputs="Story")
 
 
 
 
 
 
 
8
  interface.launch()
 
4
  story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
5
  generated_story = story_gen("<BOS> <superhero> Batman")
6
  return generated_story
7
+ interface = gr.Interface(
8
+ fn=generate_story,
9
+ title="Story Generation with GPT-2",
10
+ inputs=[gr.Textbox(lines=7, label="Story")],
11
+ description="Story generation with GPT-2",
12
+ examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]],
13
+ outputs=[gr.inputs.Textbox(label='News Summary Output')]
14
+ )
15
  interface.launch()