ganeshkamath89's picture
Experimenting with gr.inputs.Textbox for outputs
1cfb225 verified
raw
history blame
613 Bytes
import gradio as gr
from transformers import pipeline
def generate_story(story):
story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator")
generated_story = story_gen("<BOS> <superhero> Batman")
return generated_story
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=[gr.inputs.Textbox(label='News Summary Output')]
)
interface.launch()