ppsingh commited on
Commit
c9fc9f7
1 Parent(s): 9799da0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -37
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
- #### First level filter for selecting Report source/category
83
- dropdown_sources = gr.Radio(
84
- ["Consolidated", "District","Ministry"],
85
- label="Select Report Category",
86
- value="Consolidated",
87
- interactive=True,
88
- )
89
-
90
- #### second level filter for selecting subtype within the report category selected above
91
- dropdown_category = gr.Dropdown(
92
- list(files["Consolidated"].keys()),
93
- value = list(files["Consolidated"].keys())[0],
94
- label = "Filter for Sub-Type",
95
- interactive=True)
96
-
97
- #### update the secodn level filter abse don values from first level
98
- def rs_change(rs):
99
- return gr.update(choices=files[rs], value=list(files[rs].keys())[0])
100
- dropdown_sources.change(fn=rs_change, inputs=[dropdown_sources], outputs=[dropdown_category])
101
-
102
- #### Select the years for reports
103
- dropdown_year = gr.Dropdown(
104
- [2018,2019,2020,2021,2022],
105
- label="Filter for year",
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=None,
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):