ppsingh commited on
Commit
650683f
1 Parent(s): da01bb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py CHANGED
@@ -75,6 +75,35 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
75
  ################## tab for REPORTS SELECTION ##########
76
  with gr.Tab("Reports",elem_id = "tab-config",id = 2):
77
  gr.Markdown("Reminder: To get better results select the specific report/reports")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
  ############### tab for Question selection ###############
80
  with gr.TabItem("Examples",elem_id = "tab-examples",id = 0):
 
75
  ################## tab for REPORTS SELECTION ##########
76
  with gr.Tab("Reports",elem_id = "tab-config",id = 2):
77
  gr.Markdown("Reminder: To get better results select the specific report/reports")
78
+
79
+ #### First level filter for selecting Report source/category
80
+ dropdown_sources = gr.Radio(
81
+ ["Consolidated", "District","Ministry"],
82
+ label="Select Report Category",
83
+ value="Consolidated",
84
+ interactive=True,
85
+ )
86
+
87
+ #### second level filter for selecting subtype within the report category selected above
88
+ dropdown_category = gr.Dropdown(
89
+ list(files["Consolidated"].keys()),
90
+ value = list(files["Consolidated"].keys())[0],
91
+ label = "Filter for Sub-Type",
92
+ interactive=True)
93
+
94
+ #### update the secodn level filter abse don values from first level
95
+ def rs_change(rs):
96
+ return gr.update(choices=files[rs], value=list(files[rs].keys())[0])
97
+ dropdown_sources.change(fn=rs_change, inputs=[dropdown_sources], outputs=[dropdown_category])
98
+
99
+ #### Select the years for reports
100
+ dropdown_year = gr.Dropdown(
101
+ [2018,2019,2020,2021,2022],
102
+ label="Filter for year",
103
+ multiselect=True,
104
+ value=[2022],
105
+ interactive=True,
106
+ )
107
 
108
  ############### tab for Question selection ###############
109
  with gr.TabItem("Examples",elem_id = "tab-examples",id = 0):