Spaces:
Sleeping
Sleeping
Debug 12
Browse files- Patient1.csv +4 -0
- Patient2.csv +4 -0
- Patient3.csv +4 -0
- app.py +9 -3
Patient1.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Phase,XXX1
|
2 |
+
Activity,YYY
|
3 |
+
Start date,2024-01-01
|
4 |
+
End date,2024-01-31
|
Patient2.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Phase,XXX2
|
2 |
+
Activity,YYY
|
3 |
+
Start date,2024-01-01
|
4 |
+
End date,2024-01-31
|
Patient3.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Phase,XXX3
|
2 |
+
Activity,YYY
|
3 |
+
Start date,2024-01-01
|
4 |
+
End date,2024-01-31
|
app.py
CHANGED
@@ -36,9 +36,12 @@ import gradio as gr
|
|
36 |
|
37 |
# demo.launch(debug=True)
|
38 |
|
39 |
-
def
|
40 |
return {"Death": 0.9, "Alive": 0.1}
|
41 |
|
|
|
|
|
|
|
42 |
with gr.Blocks() as demo:
|
43 |
with gr.Row():
|
44 |
with gr.Column():
|
@@ -57,7 +60,10 @@ with gr.Blocks() as demo:
|
|
57 |
patient_3_download_btn = gr.DownloadButton("Download 3")
|
58 |
with gr.Column():
|
59 |
result = gr.Label(num_top_classes=2, label="Predictions")
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
62 |
|
63 |
demo.launch(debug=True)
|
|
|
36 |
|
37 |
# demo.launch(debug=True)
|
38 |
|
39 |
+
def predict():
|
40 |
return {"Death": 0.9, "Alive": 0.1}
|
41 |
|
42 |
+
def download_patient():
|
43 |
+
return "Patient1.csv"
|
44 |
+
|
45 |
with gr.Blocks() as demo:
|
46 |
with gr.Row():
|
47 |
with gr.Column():
|
|
|
60 |
patient_3_download_btn = gr.DownloadButton("Download 3")
|
61 |
with gr.Column():
|
62 |
result = gr.Label(num_top_classes=2, label="Predictions")
|
63 |
+
|
64 |
+
# Choose a patient to predict.
|
65 |
+
patient_1_input_btn.click(fn=predict, inputs=None, outputs=result, api_name="predict")
|
66 |
+
patient_1_download_btn.click(fn=download_patient, inputs=None, outputs=[patient_1_download_btn])
|
67 |
+
|
68 |
|
69 |
demo.launch(debug=True)
|