Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -437,7 +437,6 @@ def create_demo():
|
|
| 437 |
with gr.Row():
|
| 438 |
submit_btn = gr.Button("Submit")
|
| 439 |
clear_btn = gr.Button("Clear")
|
| 440 |
-
cancel_btn = gr.Button("Cancel", variant="secondary")
|
| 441 |
|
| 442 |
progress_md = gr.Markdown("Idle")
|
| 443 |
output_md = gr.Markdown("")
|
|
@@ -722,13 +721,6 @@ def create_demo():
|
|
| 722 |
def _start_processing(url, prompt, key):
|
| 723 |
return "busy", None, None
|
| 724 |
|
| 725 |
-
submit_btn.click(
|
| 726 |
-
fn=_start_processing,
|
| 727 |
-
inputs=[url_input, custom_prompt, api_key],
|
| 728 |
-
outputs=[status_state, output_md, preview_path_state],
|
| 729 |
-
queue=False,
|
| 730 |
-
)
|
| 731 |
-
|
| 732 |
submit_btn.click(
|
| 733 |
fn=worker,
|
| 734 |
inputs=[url_input, custom_prompt, api_key],
|
|
@@ -747,22 +739,6 @@ def create_demo():
|
|
| 747 |
}
|
| 748 |
return labels.get(s, "Submit")
|
| 749 |
|
| 750 |
-
cancel_btn = gr.Button("Cancel", variant="secondary")
|
| 751 |
-
|
| 752 |
-
def _cancel():
|
| 753 |
-
demo.cancel_all()
|
| 754 |
-
return "idle", "", "", "idle", "Idle", "", ""
|
| 755 |
-
|
| 756 |
-
cancel_btn.click(
|
| 757 |
-
fn=_cancel,
|
| 758 |
-
inputs=[],
|
| 759 |
-
outputs=[
|
| 760 |
-
status_state, output_md, preview_path_state,
|
| 761 |
-
progress_md, preview_status, preview_image, preview_video,
|
| 762 |
-
],
|
| 763 |
-
queue=False,
|
| 764 |
-
)
|
| 765 |
-
|
| 766 |
status_state.change(fn=lambda s: _btn_label_for_status(s), inputs=[status_state], outputs=[submit_btn])
|
| 767 |
|
| 768 |
def status_to_progress_text(s):
|
|
|
|
| 437 |
with gr.Row():
|
| 438 |
submit_btn = gr.Button("Submit")
|
| 439 |
clear_btn = gr.Button("Clear")
|
|
|
|
| 440 |
|
| 441 |
progress_md = gr.Markdown("Idle")
|
| 442 |
output_md = gr.Markdown("")
|
|
|
|
| 721 |
def _start_processing(url, prompt, key):
|
| 722 |
return "busy", None, None
|
| 723 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 724 |
submit_btn.click(
|
| 725 |
fn=worker,
|
| 726 |
inputs=[url_input, custom_prompt, api_key],
|
|
|
|
| 739 |
}
|
| 740 |
return labels.get(s, "Submit")
|
| 741 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 742 |
status_state.change(fn=lambda s: _btn_label_for_status(s), inputs=[status_state], outputs=[submit_btn])
|
| 743 |
|
| 744 |
def status_to_progress_text(s):
|