Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,6 +21,11 @@ def greet(v, progress=gr.Progress(track_tqdm=True)):
|
|
| 21 |
yield data, ret
|
| 22 |
return None, result
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
with gr.Blocks() as demo:
|
| 25 |
with gr.Row():
|
| 26 |
input = [
|
|
@@ -32,13 +37,13 @@ with gr.Blocks() as demo:
|
|
| 32 |
]
|
| 33 |
btn = gr.Button(value="Submit")
|
| 34 |
|
| 35 |
-
btn.click(
|
| 36 |
|
| 37 |
gr.Examples(
|
| 38 |
examples=[os.path.join(os.path.dirname(__file__), "example/test.mp4")],
|
| 39 |
inputs=input,
|
| 40 |
outputs=output,
|
| 41 |
-
fn=
|
| 42 |
cache_examples=False,
|
| 43 |
)
|
| 44 |
demo.queue().launch(debug=True)
|
|
|
|
| 21 |
yield data, ret
|
| 22 |
return None, result
|
| 23 |
|
| 24 |
+
def greet2(v, progress=gr.Progress(track_tqdm=True)):
|
| 25 |
+
for img in progress.tqdm(v):
|
| 26 |
+
yield img, ""
|
| 27 |
+
return None, "finish"
|
| 28 |
+
|
| 29 |
with gr.Blocks() as demo:
|
| 30 |
with gr.Row():
|
| 31 |
input = [
|
|
|
|
| 37 |
]
|
| 38 |
btn = gr.Button(value="Submit")
|
| 39 |
|
| 40 |
+
btn.click(greet2, inputs=input, outputs=output)
|
| 41 |
|
| 42 |
gr.Examples(
|
| 43 |
examples=[os.path.join(os.path.dirname(__file__), "example/test.mp4")],
|
| 44 |
inputs=input,
|
| 45 |
outputs=output,
|
| 46 |
+
fn=greet2,
|
| 47 |
cache_examples=False,
|
| 48 |
)
|
| 49 |
demo.queue().launch(debug=True)
|