Spaces:
Runtime error
Runtime error
import gradio as gr | |
from model import Model | |
examples = [ | |
"an astronaut waving the arm on the moon", | |
"a sloth surfing on a wakeboard", | |
"an astronaut walking on a street", | |
"a cute cat walking on grass", | |
"a horse is galloping on a street", | |
"an astronaut is skiing down the hill", | |
"a gorilla walking alone down the street" | |
"a gorilla dancing on times square", | |
"A panda dancing dancing like crazy on Times Square", | |
] | |
def create_demo(model: Model): | |
with gr.Blocks() as demo: | |
with gr.Row(): | |
gr.Markdown('## Text2Video-Zero: Video Generation') | |
with gr.Row(): | |
with gr.Column(): | |
prompt = gr.Textbox(label='Prompt') | |
run_button = gr.Button(label='Run') | |
with gr.Column(): | |
result = gr.Video(label="Generated Video") | |
inputs = [ | |
prompt, | |
] | |
gr.Examples(examples=examples, | |
inputs=inputs, | |
outputs=result, | |
cache_examples=False, | |
#cache_examples=os.getenv('SYSTEM') == 'spaces') | |
run_on_click=False, | |
) | |
run_button.click(fn=model.process_text2video, | |
inputs=inputs, | |
outputs=result,) | |
return demo | |