Spaces:
Sleeping
Sleeping
File size: 660 Bytes
31ebfd4 c706b84 d29b1f6 c706b84 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | import spaces
import gradio as gr
from models.story_generator import generate_story
@spaces.GPU
def run(prompt, length):
story = generate_story(prompt, length)
return story
demo = gr.Interface(
fn=run,
inputs=[
gr.Textbox(
lines=3,
label="Story Prompt",
placeholder="Tell me a story about Akbar and Birbal..."
),
gr.Dropdown(
["short", "medium", "long"],
value="short",
label="Story Length"
)
],
outputs=gr.Textbox(
lines=20,
label="Generated Story"
),
title="Smart Cultural Storyteller"
)
demo.launch() |