tnt306 commited on
Commit
99e8682
·
1 Parent(s): 91d6cca
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -36,18 +36,16 @@ import gradio as gr
36
 
37
  # demo.launch(debug=True)
38
 
 
 
 
39
  with gr.Blocks() as demo:
40
  with gr.Row():
41
  with gr.Column():
42
- file = gr.File(label="Upload A Patient",
43
- file_types = ['.csv'],
44
- file_count = "single")
45
- # patient_upload_btn = gr.UploadButton(label="Upload A Patient",
46
- # file_types = ['.csv'],
47
- # file_count = "single")
48
  with gr.Row():
49
- # patient_1_input_btn = gr.Button("Patient 1")
50
- # patient_1_download_btn = gr.DownloadButton("Download 1")
51
  with gr.Column(min_width=100):
52
  patient_1_input_btn = gr.Button("Patient 1")
53
  patient_1_download_btn = gr.DownloadButton("Download 1")
@@ -58,6 +56,8 @@ with gr.Blocks() as demo:
58
  patient_3_input_btn = gr.Button("Patient 3")
59
  patient_3_download_btn = gr.DownloadButton("Download 3")
60
  with gr.Column():
61
- btn1 = gr.Button("Will Display Output")
 
 
62
 
63
  demo.launch(debug=True)
 
36
 
37
  # demo.launch(debug=True)
38
 
39
+ def greet():
40
+ return {"Death": 0.9, "Alive": 0.1}
41
+
42
  with gr.Blocks() as demo:
43
  with gr.Row():
44
  with gr.Column():
45
+ patient_upload_file = gr.File(label="Upload A Patient",
46
+ file_types = ['.csv'],
47
+ file_count = "single")
 
 
 
48
  with gr.Row():
 
 
49
  with gr.Column(min_width=100):
50
  patient_1_input_btn = gr.Button("Patient 1")
51
  patient_1_download_btn = gr.DownloadButton("Download 1")
 
56
  patient_3_input_btn = gr.Button("Patient 3")
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
+ patient_1_input_btn.click(fn=greet, inputs=None, outputs=result, api_name="greet")
62
 
63
  demo.launch(debug=True)