File size: 2,388 Bytes
6dc443d
47d95c0
5ccc81c
 
6dc443d
 
 
72baa29
 
6dc443d
06a1d7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47d95c0
 
3e38893
 
49abb69
 
 
3e38893
af75ec3
 
31b3b1a
af75ec3
 
31b3b1a
af75ec3
 
31b3b1a
06f8e37
 
3e38893
 
06a1d7b
5ccc81c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from typing import Dict
from pathlib import Path
import pandas as pd
from io import StringIO

import gradio as gr

# def predict(text: str) -> Dict:
#     return {"alive": 0.9, "death": 0.1}
    
# example_list = [[1.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 0.0]]

# # Create title, description and article strings
# title = "This is title."
# description = "This is description."
# article = "This is article."

# default_csv = "Phase,Activity,Start date,End date\n\"Mapping the Field\",\"Literature review\",2024-01-01,2024-01-31"

# def process_csv_text(temp_file):
#     if isinstance(temp_file, str):
#         print("1")
#         df = pd.read_csv(temp_file, header = "infer", sep = ",", encoding = "utf-8")
#     else:
#         print("2")
#         df = pd.read_csv(temp_file.name)
#     print("***")
#     print(df)
#     print("***")
#     return df

# with gr.Blocks() as demo:
#     upload_button = gr.UploadButton(label="Upload Timetable", file_types = ['.csv'], file_count = "single")    
#     table = gr.Dataframe(headers=["Phase", "Activity", "Start date", "End date"], type="pandas", col_count=4)
#     upload_button.upload(fn=process_csv_text, inputs=upload_button, outputs=table, api_name="upload_csv")

# demo.launch(debug=True)

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            patient_upload_btn = gr.UploadButton(label="Upload A Patient", 
                                                    file_types = ['.csv'],
                                                    file_count = "single")
            with gr.Row():
                # patient_1_input_btn = gr.Button("Patient 1")
                # patient_1_download_btn = gr.DownloadButton("Download 1")
                with gr.Column(min_width=100):
                    patient_1_input_btn = gr.Button("Patient 1")
                    patient_1_download_btn = gr.DownloadButton("Download 1")
                with gr.Column(min_width=100):
                    patient_2_input_btn = gr.Button("Patient 2")
                    patient_2_download_btn = gr.DownloadButton("Download 2")
                with gr.Column(min_width=100):
                    patient_3_input_btn = gr.Button("Patient 3")
                    patient_3_download_btn = gr.DownloadButton("Download 3")
        with gr.Column():
            btn1 = gr.Button("Will Display Output")
    
demo.launch(debug=True)