Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,12 @@ import gradio as gr
|
|
26 |
CHOICES = ["SNOMED", "LOINC", "CQM"]
|
27 |
JSONOBJ = """{"items":{"item":[{"id": "0001","type": null,"is_good": false,"ppu": 0.55,"batters":{"batter":[{ "id": "1001", "type": "Regular" },{ "id": "1002", "type": "Chocolate" },{ "id": "1003", "type": "Blueberry" },{ "id": "1004", "type": "Devil's Food" }]},"topping":[{ "id": "5001", "type": "None" },{ "id": "5002", "type": "Glazed" },{ "id": "5005", "type": "Sugar" },{ "id": "5007", "type": "Powdered Sugar" },{ "id": "5006", "type": "Chocolate with Sprinkles" },{ "id": "5003", "type": "Chocolate" },{ "id": "5004", "type": "Maple" }]}]}}"""
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
#def fn( text1, text2, num, slider1, slider2, single_checkbox, checkboxes, radio, dropdown, im1, im2, im3, im4,
|
31 |
# video, audio1, audio2, file, df1, df2,):
|
@@ -60,7 +66,10 @@ def fn( text1, text2, single_checkbox, checkboxes, radio, im4,
|
|
60 |
(".", 0),
|
61 |
] + [(f"test", x / 10) for x in range(-10, 10)], # HighlightedText
|
62 |
|
63 |
-
|
|
|
|
|
|
|
64 |
"<button style='background-color: red'>Click Me: " + radio + "</button>", # HTML
|
65 |
os.path.join(os.path.dirname(__file__), "files/titanic.csv"),
|
66 |
df1, # Dataframe
|
@@ -136,6 +145,7 @@ demo = gr.Interface(
|
|
136 |
cache_examples=False,
|
137 |
description="Clinical Terminology Auto Mapper AI",
|
138 |
article="Learn more at [Yggdrasil](https://github.com/AaronCWacker/Yggdrasil)",
|
|
|
139 |
)
|
140 |
|
141 |
if __name__ == "__main__":
|
|
|
26 |
CHOICES = ["SNOMED", "LOINC", "CQM"]
|
27 |
JSONOBJ = """{"items":{"item":[{"id": "0001","type": null,"is_good": false,"ppu": 0.55,"batters":{"batter":[{ "id": "1001", "type": "Regular" },{ "id": "1002", "type": "Chocolate" },{ "id": "1003", "type": "Blueberry" },{ "id": "1004", "type": "Devil's Food" }]},"topping":[{ "id": "5001", "type": "None" },{ "id": "5002", "type": "Glazed" },{ "id": "5005", "type": "Sugar" },{ "id": "5007", "type": "Powdered Sugar" },{ "id": "5006", "type": "Chocolate with Sprinkles" },{ "id": "5003", "type": "Chocolate" },{ "id": "5004", "type": "Maple" }]}]}}"""
|
28 |
|
29 |
+
def lowercase_title(example):
|
30 |
+
return {"title": example[title].lower()}
|
31 |
+
|
32 |
+
# demonstrate map function of dataset
|
33 |
+
JSONOBJ_MAP=datasetLOINC.map(lowercase_title)
|
34 |
+
|
35 |
|
36 |
#def fn( text1, text2, num, slider1, slider2, single_checkbox, checkboxes, radio, dropdown, im1, im2, im3, im4,
|
37 |
# video, audio1, audio2, file, df1, df2,):
|
|
|
66 |
(".", 0),
|
67 |
] + [(f"test", x / 10) for x in range(-10, 10)], # HighlightedText
|
68 |
|
69 |
+
|
70 |
+
#json.loads(JSONOBJ), # JSON
|
71 |
+
json.loads(JSONOBJ_MAP), # JSONOBJ_MAP
|
72 |
+
|
73 |
"<button style='background-color: red'>Click Me: " + radio + "</button>", # HTML
|
74 |
os.path.join(os.path.dirname(__file__), "files/titanic.csv"),
|
75 |
df1, # Dataframe
|
|
|
145 |
cache_examples=False,
|
146 |
description="Clinical Terminology Auto Mapper AI",
|
147 |
article="Learn more at [Yggdrasil](https://github.com/AaronCWacker/Yggdrasil)",
|
148 |
+
live=True,
|
149 |
)
|
150 |
|
151 |
if __name__ == "__main__":
|