ppsingh commited on
Commit
20f0072
1 Parent(s): 340e8a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -31
app.py CHANGED
@@ -201,6 +201,51 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
201
 
202
 
203
  with gr.Tabs() as tabs:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  with gr.TabItem("Examples",elem_id = "tab-examples",id = 0):
205
 
206
  examples_hidden = gr.Textbox(visible = False)
@@ -227,37 +272,6 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
227
 
228
  samples.append(group_examples)
229
 
230
- with gr.Tab("Reports",elem_id = "tab-config",id = 2):
231
-
232
- gr.Markdown("Reminder: To get better results select the specific report/reports")
233
-
234
-
235
- dropdown_sources = gr.Dropdown(
236
- ["Consolidated Reports", "District","Ministry"],
237
- label="Select source",
238
- value=["Ministry"],
239
- interactive=True,
240
- )
241
-
242
- dropdown_reports = gr.Dropdown(
243
- POSSIBLE_REPORTS,
244
- label="Or select specific reports",
245
- multiselect=True,
246
- value=None,
247
- interactive=True,
248
- )
249
-
250
- #dropdown_audience = "Experts"
251
- #dropdown_audience = gr.Dropdown(
252
- # ["Children","General public","Experts"],
253
- # label="Select audience",
254
- # value="Experts",
255
- # interactive=True,
256
- #)
257
-
258
- output_query = gr.Textbox(label="Query used for retrieval",show_label = True,elem_id = "reformulated-query",lines = 2,interactive = False)
259
- #output_language = gr.Textbox(label="Language",show_label = True,elem_id = "language",lines = 1,interactive = False)
260
-
261
 
262
  with gr.Tab("Sources",elem_id = "tab-citations",id = 1):
263
  sources_textbox = gr.HTML(show_label=False, elem_id="sources-textbox")
 
201
 
202
 
203
  with gr.Tabs() as tabs:
204
+
205
+ with gr.Tab("Reports",elem_id = "tab-config",id = 2):
206
+
207
+ gr.Markdown("Reminder: To get better results select the specific report/reports")
208
+
209
+ dropdown_sources = gr.Radio(
210
+ ["Consolidated", "District","Ministry"],
211
+ label="Select Report Source",
212
+ value="Consolidated",
213
+ interactive=True,
214
+ )
215
+
216
+ dropdown_category = gr.Dropdown(
217
+ list(files["Consolidated"].keys()),
218
+ value = list(files["Consolidated"].keys())[0],
219
+ label = "Filter for Sub-Type",
220
+ interactive=True)
221
+
222
+ def rs_change(rs):
223
+ return gr.update(choices=files[rs], value=list(files[rs].keys())[0])
224
+
225
+ dropdown_sources.change(fn=rs_change, inputs=[dropdown_sources], outputs=[dropdown_category])
226
+
227
+ dropdown_year = gr.Dropdown(
228
+ [2018,2019,2020,2021,2022,2023],
229
+ label="Filter for year",
230
+ multiselect=True,
231
+ value=[2023],
232
+ interactive=True,
233
+ )
234
+
235
+ dropdown_reports = gr.Dropdown(
236
+ POSSIBLE_REPORTS,
237
+ label="Or select specific reports",
238
+ multiselect=True,
239
+ value=None,
240
+ interactive=True,
241
+ )
242
+
243
+ output_query = gr.Textbox(label="Query used for retrieval",show_label = True,elem_id = "reformulated-query",lines = 2,interactive = False)
244
+ #output_language = gr.Textbox(label="Language",show_label = True,elem_id = "language",lines = 1,interactive = False)
245
+
246
+
247
+
248
+
249
  with gr.TabItem("Examples",elem_id = "tab-examples",id = 0):
250
 
251
  examples_hidden = gr.Textbox(visible = False)
 
272
 
273
  samples.append(group_examples)
274
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
 
276
  with gr.Tab("Sources",elem_id = "tab-citations",id = 1):
277
  sources_textbox = gr.HTML(show_label=False, elem_id="sources-textbox")