Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,4 +116,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 116 |
submit_btn = gr.Button("开始处理 (Process)", variant="primary")
|
| 117 |
submit_btn.click(fn=run_task, inputs=[input_img, gr.State(task_name)], outputs=output_img)
|
| 118 |
if EXAMPLE_IMAGES.get(task_name):
|
| 119 |
-
gr.Examples(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
submit_btn = gr.Button("开始处理 (Process)", variant="primary")
|
| 117 |
submit_btn.click(fn=run_task, inputs=[input_img, gr.State(task_name)], outputs=output_img)
|
| 118 |
if EXAMPLE_IMAGES.get(task_name):
|
| 119 |
+
gr.Examples(
|
| 120 |
+
examples=EXAMPLE_IMAGES.get(task_name, []),
|
| 121 |
+
inputs=input_img,
|
| 122 |
+
outputs=output_img,
|
| 123 |
+
fn=lambda img: run_task(img, task_name=task_name), # 示例点击时不传递 progress
|
| 124 |
+
cache_examples=True
|
| 125 |
+
)
|
| 126 |
+
|
| 127 |
+
demo.launch(server_name="0.0.0.0")
|