File size: 1,935 Bytes
d112e03
 
 
 
 
 
d70b6d1
d112e03
a1ecdea
 
198f303
 
2768c19
a1ecdea
 
 
 
 
 
 
 
 
 
 
 
 
2768c19
 
7a3bb8b
a1ecdea
8516727
 
 
2768c19
 
a1ecdea
 
d112e03
f471cec
72f5237
 
 
 
 
d112e03
 
8516727
d112e03
f471cec
 
 
d112e03
f471cec
d112e03
9c554b3
d112e03
77a679c
d112e03
556dd4e
d112e03
f471cec
 
 
 
 
 
 
508cff5
e84c3c9
508cff5
556dd4e
ba07bb9
f471cec
 
bea231e
f471cec
032fb3b
ef85d88
032fb3b
ef85d88
032fb3b
f471cec
032fb3b
f471cec
c901346
ef85d88
d112e03
f471cec
bea231e
7b0a13a
032fb3b
d112e03
 
 
 
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import gradio as gr

from queue import PriorityQueue

from datetime import datetime

pq = PriorityQueue()

date_format = '%m-%d-%Y at %H:%M'

import os 


def writer(pair):

    final = pair[1] + ' is due on '    
    final += f'{pair[0].month:02}-{pair[0].day:02}-{pair[0].year} at '
    final += f'{pair[0].hour:02}:{pair[0].minute:02}'

    return final


def string_rep(pq):

    work = ""

    temp = PriorityQueue()

    while not pq.empty():

        elem = pq.get()
        temp.put(elem)
        work += writer(elem) + '\n'

    pq.queue = temp.queue

    return work


def inputter(date_str = None, item_name = None, add = "Show"):

    if add == "Show":

        return string_rep(pq)

    cur_date = datetime.strptime(date_str, date_format)
    item_name = item_name.strip()

    if add == "Add":

        pq.put((cur_date, item_name))

    else:

        remove((cur_date, item_name))

    return string_rep(pq)



def remove(element):

    temp = PriorityQueue()

    while not pq.empty():

        elem = pq.get()
        if elem != element:
            
            temp.put(elem)

    pq.queue = temp.queue


datalink = gr.Textbox(label="Enter your data link here:", placeholder="e.g., https://sample_data.tar.gz")

databox = gr.Textbox(label="Enter your data type here:", placeholder="e.g., images, genome, binary")

augbox = gr.Textbox(label="Enter your data augmentation methods here:", placeholder="Enter as list e.g., [flip, rotate]")

machinebox = gr.Textbox(label="Enter your machine type:", placeholder="e.g., transformer, SVM, CNN")

featurebox = gr.Textbox(label="Enter your features type:", placeholder="e.g., KL-expansion, Lagragians")

ouputbox = gr.Textbox(label="Output", placeholder="Accuracy: 100%", lines  = 10)

iface = gr.Interface(
    fn=inputter,  
    inputs=[datalink, databox, augbox, featurebox, machinebox],  
    outputs=ouputbox,  
    title="Cancer Metapipeline",
)

iface.launch()