Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -62,33 +62,36 @@ def calculate_accuracy(flood_selections, fire_selections, none_selections, num_p
|
|
62 |
return incorrect, correct, accuracy, data_df, gr.DownloadButton(label=f"Download CSV", value="output.csv", visible=True)
|
63 |
|
64 |
def init_queries(history):
|
65 |
-
history = [
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
87 |
|
88 |
return gr.CheckboxGroup(choices=history), history
|
89 |
|
90 |
def add_query(to_add, history):
|
91 |
-
history
|
|
|
92 |
return gr.CheckboxGroup(choices=history), history
|
93 |
|
94 |
with gr.Blocks() as demo:
|
|
|
62 |
return incorrect, correct, accuracy, data_df, gr.DownloadButton(label=f"Download CSV", value="output.csv", visible=True)
|
63 |
|
64 |
def init_queries(history):
|
65 |
+
history = history or []
|
66 |
+
if not history:
|
67 |
+
history = [
|
68 |
+
"What areas are being evacuated?",
|
69 |
+
"What areas are predicted to be impacted?",
|
70 |
+
"What areas are without power?",
|
71 |
+
"What barriers are hindering response efforts?",
|
72 |
+
"What events have been canceled?",
|
73 |
+
"What preparations are being made?",
|
74 |
+
"What regions have announced a state of emergency?",
|
75 |
+
"What roads are blocked / closed?",
|
76 |
+
"What services have been closed?",
|
77 |
+
"What warnings are currently in effect?",
|
78 |
+
"Where are emergency services deployed?",
|
79 |
+
"Where are emergency services needed?",
|
80 |
+
"Where are evacuations needed?",
|
81 |
+
"Where are people needing rescued?",
|
82 |
+
"Where are recovery efforts taking place?",
|
83 |
+
"Where has building or infrastructure damage occurred?",
|
84 |
+
"Where has flooding occured?"
|
85 |
+
"Where are volunteers being requested?",
|
86 |
+
"Where has road damage occured?",
|
87 |
+
"What area has the wildfire burned?",
|
88 |
+
"Where have homes been damaged or destroyed?"]
|
89 |
|
90 |
return gr.CheckboxGroup(choices=history), history
|
91 |
|
92 |
def add_query(to_add, history):
|
93 |
+
if to_add not in history:
|
94 |
+
history.append(to_add)
|
95 |
return gr.CheckboxGroup(choices=history), history
|
96 |
|
97 |
with gr.Blocks() as demo:
|