Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -77,45 +77,43 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
|
|
77 |
with gr.Tab("Reports",elem_id = "tab-config",id = 2):
|
78 |
gr.Markdown("Reminder: To get better results select the specific report/reports")
|
79 |
|
80 |
-
with gr.Row():
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
multiselect=True,
|
107 |
-
value=[2022],
|
108 |
-
interactive=True,
|
109 |
-
)
|
110 |
-
|
111 |
-
##### Another way to select reports across category and sub-type
|
112 |
-
with gr.Row():
|
113 |
-
dropdown_reports = gr.Dropdown(
|
114 |
-
POSSIBLE_REPORTS,
|
115 |
-
label="Or select specific reports",
|
116 |
multiselect=True,
|
117 |
-
value=
|
118 |
-
interactive=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
############### tab for Question selection ###############
|
121 |
with gr.TabItem("Examples",elem_id = "tab-examples",id = 0):
|
|
|
77 |
with gr.Tab("Reports",elem_id = "tab-config",id = 2):
|
78 |
gr.Markdown("Reminder: To get better results select the specific report/reports")
|
79 |
|
|
|
80 |
|
81 |
+
#### First level filter for selecting Report source/category
|
82 |
+
dropdown_sources = gr.Radio(
|
83 |
+
["Consolidated", "District","Ministry"],
|
84 |
+
label="Select Report Category",
|
85 |
+
value="Consolidated",
|
86 |
+
interactive=True,
|
87 |
+
)
|
88 |
+
|
89 |
+
#### second level filter for selecting subtype within the report category selected above
|
90 |
+
dropdown_category = gr.Dropdown(
|
91 |
+
list(files["Consolidated"].keys()),
|
92 |
+
value = list(files["Consolidated"].keys())[0],
|
93 |
+
label = "Filter for Sub-Type",
|
94 |
+
interactive=True)
|
95 |
+
|
96 |
+
#### update the secodn level filter abse don values from first level
|
97 |
+
def rs_change(rs):
|
98 |
+
return gr.update(choices=files[rs], value=list(files[rs].keys())[0])
|
99 |
+
dropdown_sources.change(fn=rs_change, inputs=[dropdown_sources], outputs=[dropdown_category])
|
100 |
+
|
101 |
+
#### Select the years for reports
|
102 |
+
dropdown_year = gr.Dropdown(
|
103 |
+
[2018,2019,2020,2021,2022],
|
104 |
+
label="Filter for year",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
multiselect=True,
|
106 |
+
value=[2022],
|
107 |
+
interactive=True,
|
108 |
+
)
|
109 |
+
gr.Markdown("-------------------------------------------------------------------------")
|
110 |
+
##### Another way to select reports across category and sub-type
|
111 |
+
dropdown_reports = gr.Dropdown(
|
112 |
+
POSSIBLE_REPORTS,
|
113 |
+
label="Or select specific reports",
|
114 |
+
multiselect=True,
|
115 |
+
value=None,
|
116 |
+
interactive=True,)
|
117 |
|
118 |
############### tab for Question selection ###############
|
119 |
with gr.TabItem("Examples",elem_id = "tab-examples",id = 0):
|