rameshmoorthy
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -151,15 +151,21 @@ def generate_report(file, type):
|
|
151 |
|
152 |
|
153 |
return temp_file1.name ,temp_file3.name ,variable_table(df),dfviz,sd1
|
|
|
154 |
def handle_click(file, sheet_name):
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
return results
|
159 |
|
160 |
def update_sheets(file):
|
161 |
sheet_names = pd.ExcelFile(file).sheet_names
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
with gr.Blocks() as cluster:
|
165 |
with gr.Column():
|
@@ -194,6 +200,6 @@ with gr.Blocks() as cluster:
|
|
194 |
dataframe2=gr.Dataframe()
|
195 |
|
196 |
btn.click(handle_click, inputs=[file, sheet_dropdown], outputs=[out1, out2, var, dataframe1, dataframe2])
|
197 |
-
file.change(update_sheets, inputs=file, outputs=
|
198 |
#btn.click(generate_report,inputs=[file],outputs=[out1,out2,var,dataframe1,dataframe2])
|
199 |
cluster.launch()
|
|
|
151 |
|
152 |
|
153 |
return temp_file1.name ,temp_file3.name ,variable_table(df),dfviz,sd1
|
154 |
+
|
155 |
def handle_click(file, sheet_name):
|
156 |
+
|
157 |
+
results = generate_report(file, sheet_name)
|
158 |
+
return results
|
|
|
159 |
|
160 |
def update_sheets(file):
|
161 |
sheet_names = pd.ExcelFile(file).sheet_names
|
162 |
+
|
163 |
+
|
164 |
+
sheet_dropdown = gr.Dropdown(
|
165 |
+
label="Select sheet", choices=[sheet_names], visible=True # Initially disabled
|
166 |
+
)
|
167 |
+
return sheet_dropdown
|
168 |
+
|
169 |
|
170 |
with gr.Blocks() as cluster:
|
171 |
with gr.Column():
|
|
|
200 |
dataframe2=gr.Dataframe()
|
201 |
|
202 |
btn.click(handle_click, inputs=[file, sheet_dropdown], outputs=[out1, out2, var, dataframe1, dataframe2])
|
203 |
+
file.change(update_sheets, inputs=file, outputs=sheet_dropdown)
|
204 |
#btn.click(generate_report,inputs=[file],outputs=[out1,out2,var,dataframe1,dataframe2])
|
205 |
cluster.launch()
|