ppsingh commited on
Commit
da53bed
1 Parent(s): c8edba3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -8,7 +8,7 @@ from datetime import datetime
8
  from pathlib import Path
9
  from huggingface_hub import CommitScheduler
10
  from auditqa.sample_questions import QUESTIONS
11
- from auditqa.reports import files, report_list
12
  from auditqa.process_chunks import load_chunks, getconfig, get_local_qdrant, load_new_chunks
13
  from auditqa.retriever import get_context
14
  from auditqa.reader import nvidia_client, dedicated_endpoint
@@ -233,8 +233,8 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
233
 
234
 
235
  #----- First level filter for selecting Report source/category ----------
236
- dropdown_sources = gr.Radio(
237
- ["Consolidated", "District","Ministry"],
238
  label="Select Report Category",
239
  value="Consolidated",
240
  interactive=True,
@@ -242,28 +242,28 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
242
 
243
  #------ second level filter for selecting subtype within the report category selected above
244
  dropdown_category = gr.Dropdown(
245
- list(files["Consolidated"].keys()),
246
- value = list(files["Consolidated"].keys())[0],
247
  label = "Filter for Sub-Type",
248
  interactive=True)
249
 
250
  #----------- update the secodn level filter abse don values from first level ----------------
251
  def rs_change(rs):
252
- return gr.update(choices=files[rs], value=list(files[rs].keys())[0])
253
  dropdown_sources.change(fn=rs_change, inputs=[dropdown_sources], outputs=[dropdown_category])
254
 
255
  #--------- Select the years for reports -------------------------------------
256
  dropdown_year = gr.Dropdown(
257
- ['2018','2019','2020','2021','2022'],
258
  label="Filter for year",
259
  multiselect=True,
260
- value=['2022'],
261
  interactive=True,
262
  )
263
  gr.Markdown("-------------------------------------------------------------------------")
264
  #---------------- Another way to select reports across category and sub-type ------------
265
  dropdown_reports = gr.Dropdown(
266
- report_list,
267
  label="Or select specific reports",
268
  multiselect=True,
269
  value=[],
 
8
  from pathlib import Path
9
  from huggingface_hub import CommitScheduler
10
  from auditqa.sample_questions import QUESTIONS
11
+ from auditqa.reports import files, report_list, new_files, new_report_list
12
  from auditqa.process_chunks import load_chunks, getconfig, get_local_qdrant, load_new_chunks
13
  from auditqa.retriever import get_context
14
  from auditqa.reader import nvidia_client, dedicated_endpoint
 
233
 
234
 
235
  #----- First level filter for selecting Report source/category ----------
236
+ dropdown_sources = gr.Dropdown(
237
+ ["Consolidated","Ministry, Department, Agency and Projects","Local Government","Value for Money","Thematic"],
238
  label="Select Report Category",
239
  value="Consolidated",
240
  interactive=True,
 
242
 
243
  #------ second level filter for selecting subtype within the report category selected above
244
  dropdown_category = gr.Dropdown(
245
+ new_files["Consolidated"],
246
+ value = new_files["Consolidated"],
247
  label = "Filter for Sub-Type",
248
  interactive=True)
249
 
250
  #----------- update the secodn level filter abse don values from first level ----------------
251
  def rs_change(rs):
252
+ return gr.update(choices=files[rs], value=new_files[rs])
253
  dropdown_sources.change(fn=rs_change, inputs=[dropdown_sources], outputs=[dropdown_category])
254
 
255
  #--------- Select the years for reports -------------------------------------
256
  dropdown_year = gr.Dropdown(
257
+ ['2018','2019','2020','2021','2022','2023'],
258
  label="Filter for year",
259
  multiselect=True,
260
+ value=['2023'],
261
  interactive=True,
262
  )
263
  gr.Markdown("-------------------------------------------------------------------------")
264
  #---------------- Another way to select reports across category and sub-type ------------
265
  dropdown_reports = gr.Dropdown(
266
+ new_report_list,
267
  label="Or select specific reports",
268
  multiselect=True,
269
  value=[],