Spaces:
Sleeping
Sleeping
Fixed confirm button
Browse files- gradio-ui.py +22 -1
gradio-ui.py
CHANGED
|
@@ -594,10 +594,31 @@ with gr.Blocks(
|
|
| 594 |
outputs=[llm_output_box, commands_box, last_state, progress_bar],
|
| 595 |
)
|
| 596 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 597 |
confirm_button.click(
|
| 598 |
fn=confirm_commands,
|
| 599 |
inputs=[last_state, progress_bar],
|
| 600 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 601 |
)
|
| 602 |
|
| 603 |
bids_validator_button.click(
|
|
|
|
| 594 |
outputs=[llm_output_box, commands_box, last_state, progress_bar],
|
| 595 |
)
|
| 596 |
|
| 597 |
+
# Show uploaded file content in the textbox.
|
| 598 |
+
def _load_dataset_xml(file_path: Optional[str]) -> str:
|
| 599 |
+
if not file_path:
|
| 600 |
+
return ""
|
| 601 |
+
try:
|
| 602 |
+
return Path(file_path).read_text(encoding="utf-8", errors="ignore")
|
| 603 |
+
except Exception as e:
|
| 604 |
+
return f"Failed to read file: {e}"
|
| 605 |
+
|
| 606 |
+
dataset_xml_file.change(
|
| 607 |
+
fn=_load_dataset_xml,
|
| 608 |
+
inputs=[dataset_xml_file],
|
| 609 |
+
outputs=[dataset_xml_input],
|
| 610 |
+
)
|
| 611 |
+
|
| 612 |
confirm_button.click(
|
| 613 |
fn=confirm_commands,
|
| 614 |
inputs=[last_state, progress_bar],
|
| 615 |
+
outputs=[llm_output_box, commands_box, last_state, progress_bar, step_dropdown, status_msg],
|
| 616 |
+
)
|
| 617 |
+
|
| 618 |
+
run_commands_button.click(
|
| 619 |
+
fn=run_commands,
|
| 620 |
+
inputs=[last_state, progress_bar],
|
| 621 |
+
outputs=[status_msg, progress_bar, step_dropdown],
|
| 622 |
)
|
| 623 |
|
| 624 |
bids_validator_button.click(
|