Spaces:
Runtime error
Runtime error
File size: 546 Bytes
a970736 084b57b ba5952d 7402477 a970736 |
1 2 3 4 5 6 7 8 |
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="label")
interface.launch() |