queue=False
Browse files
app.py
CHANGED
|
@@ -514,6 +514,7 @@ def run_pipeline_ui(
|
|
| 514 |
["Intake Historian", "Vision Specialist", "Trend Analyst", "Clinical Pharmacologist"]
|
| 515 |
if has_labs else ["Intake Historian", "Clinical Pharmacologist"]
|
| 516 |
)
|
|
|
|
| 517 |
for i, name in enumerate(stages):
|
| 518 |
progress((i + 0.5) / len(stages), desc=f"Running: {name}…")
|
| 519 |
|
|
@@ -875,7 +876,17 @@ with gr.Blocks(theme=gr.themes.Soft(), css=CSS, title="AMR-Guard") as demo:
|
|
| 875 |
inputs=[lab_method],
|
| 876 |
outputs=[lab_file, lab_paste],
|
| 877 |
)
|
|
|
|
| 878 |
run_btn.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 879 |
fn=run_pipeline_ui,
|
| 880 |
inputs=[
|
| 881 |
age, weight, height, sex,
|
|
|
|
| 514 |
["Intake Historian", "Vision Specialist", "Trend Analyst", "Clinical Pharmacologist"]
|
| 515 |
if has_labs else ["Intake Historian", "Clinical Pharmacologist"]
|
| 516 |
)
|
| 517 |
+
|
| 518 |
for i, name in enumerate(stages):
|
| 519 |
progress((i + 0.5) / len(stages), desc=f"Running: {name}…")
|
| 520 |
|
|
|
|
| 876 |
inputs=[lab_method],
|
| 877 |
outputs=[lab_file, lab_paste],
|
| 878 |
)
|
| 879 |
+
_loading_html = '<div class="badge-info" style="padding:16px;text-align:center;">⏳ Pipeline running — please wait…</div>'
|
| 880 |
run_btn.click(
|
| 881 |
+
fn=lambda: (
|
| 882 |
+
_loading_html, _loading_html, _loading_html,
|
| 883 |
+
pd.DataFrame(), _loading_html,
|
| 884 |
+
gr.update(visible=True),
|
| 885 |
+
),
|
| 886 |
+
inputs=[],
|
| 887 |
+
outputs=[rec_out, intake_out, lab_html_out, lab_df_out, safety_out, results_group],
|
| 888 |
+
queue=False,
|
| 889 |
+
).then(
|
| 890 |
fn=run_pipeline_ui,
|
| 891 |
inputs=[
|
| 892 |
age, weight, height, sex,
|