vumichien commited on
Commit
4af45f8
1 Parent(s): fe0189b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -252,7 +252,6 @@ def predict(clip_text, method='fast'):
252
 
253
 
254
  # ---- Gradio Layout -----
255
- text_prompt = gr.Textbox(label="Text prompt", lines=1, interactive=True)
256
  video_out = gr.Video(label="Motion", mirror_webcam=False, interactive=False)
257
  demo = gr.Blocks()
258
  demo.encrypt = False
@@ -299,22 +298,29 @@ with demo:
299
  ''')
300
  with gr.Column():
301
  with gr.Row():
302
- text_prompt.render()
303
  method = gr.Dropdown(["slow", "fast"], label="Method", value="slow")
304
  with gr.Row():
305
  generate_btn = gr.Button("Generate")
306
  generate_btn.click(predict, [text_prompt, method], [video_out], api_name="generate")
307
- print(video_out)
308
  with gr.Row():
309
  video_out.render()
310
  with gr.Row():
311
  gr.Markdown('''
312
  ### You can test by following examples:
313
  ''')
314
- examples = gr.Examples(examples=
315
- [ "a person jogs in place, slowly at first, then increases speed. they then back up and squat down.",
316
- "a man steps forward and does a handstand",
317
- "a man rises from the ground, walks in a circle and sits back down on the ground"],
318
- label="Examples", inputs=[text_prompt])
 
 
 
 
 
 
 
 
319
 
320
  demo.launch(debug=True)
 
252
 
253
 
254
  # ---- Gradio Layout -----
 
255
  video_out = gr.Video(label="Motion", mirror_webcam=False, interactive=False)
256
  demo = gr.Blocks()
257
  demo.encrypt = False
 
298
  ''')
299
  with gr.Column():
300
  with gr.Row():
301
+ text_prompt = gr.Textbox(label="Text prompt", lines=1, interactive=True)
302
  method = gr.Dropdown(["slow", "fast"], label="Method", value="slow")
303
  with gr.Row():
304
  generate_btn = gr.Button("Generate")
305
  generate_btn.click(predict, [text_prompt, method], [video_out], api_name="generate")
 
306
  with gr.Row():
307
  video_out.render()
308
  with gr.Row():
309
  gr.Markdown('''
310
  ### You can test by following examples:
311
  ''')
312
+ examples = gr.Examples
313
+ examples=[
314
+ ["a person jogs in place, slowly at first, then increases speed. they then back up and squat down.", "slow"],
315
+ ["a man steps forward and does a handstand", "slow"],
316
+ ["a man rises from the ground, walks in a circle and sits back down on the ground", "slow"],
317
+ ]
318
+ label="Examples",
319
+ inputs=[text_prompt, method],
320
+ outputs=[video_out],
321
+ fn=predict,
322
+ cache_examples=True,
323
+ )
324
+
325
 
326
  demo.launch(debug=True)