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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -28
app.py CHANGED
@@ -73,37 +73,49 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
73
  # creating tabs on right panel
74
  with gr.Tabs() as tabs:
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):
 
73
  # creating tabs on right panel
74
  with gr.Tabs() as tabs:
75
  ################## tab for REPORTS SELECTION ##########
76
+
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):