ganeshkamath89's picture
changing greet() to generate_story() function
c805802 verified
raw
history blame
519 Bytes
import gradio as gr
def generate_story(story):
story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
story_expanded = story_gen(story)
return story_expanded
demo = gr.Interface (
fn=generate_story,
description="Story generation with GPT-2",
examples=[["Adventurer is approached by a mysterious stranger in the tavern for a new quest"]],
inputs=[gr.Textbox(lines=7, label="Story URL")],
outputs=[gr.Textbox(lines=7, label="Story Summary")]
)
demo.launch(share=True)