Spaces:
Build error
Build error
Update app.py
Browse files150 unmodified lines1511521531541551561571588 unmodified lines1671681691701711726 unmodified lines179180181182183150 unmodified linesreturn temp_file1.name ,temp_file3.name ,variable_table(df),dfviz,sd1with gr.Blocks() as cluster:with gr.Column():gr.HTML(value="""<h1 style="color: #1999FF; text-shadow: 1px 1px 2px #ddd;">EXCEL ANALYSIS AND INSIGHTS</h1>""")8 unmodified linesout1=gr.File(label="Download CSV")gr.HTML(value="""<h2 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h2>""")out2=gr.File(label="Download CSV")with gr.Column()gr.HTML(value="""<h2 style="color: #BA4A00; text-shadow: 1px 1px 2px #ddd;"COLUMNS IN FILE</h2>"""):#gr.Markdown("***Uploaded File***")6 unmodified linesgr.HTML(value="""<h2 style="color: #BA4A00; text-shadow: 1px 1px 2px #ddd;"COLUMNS STATS AND ANALYSIS</h2>"""):#gr.Markdown("#Columns Analysis")dataframe2=gr.Dataframe()btn.click(generate_report,inputs=[file],outputs=[out1,out2,var,dataframe1,dataframe2])cluster.launch()150 unmodified lines1511521531541551561571581591601611621631641651668 unmodified lines1751761771781791801811821831841856 unmodified lines192193194195196197198199150 unmodified linesreturn temp_file1.name ,temp_file3.name ,variable_table(df),dfviz,sd1def handle_click(file, sheet_name):sheet_dropdown.update(disabled=True) # Disable during report generationresults = generate_report(file, sheet_name)sheet_dropdown.update(disabled=False) # Re-enable sheet selectionreturn resultsdef update_sheets(file):sheet_names = pd.ExcelFile(file).sheet_namessheet_dropdown.update(options=sheet_names, disabled=False)with gr.Blocks() as cluster:with gr.Column():gr.HTML(value="""<h1 style="color: #1999FF; text-shadow: 1px 1px 2px #ddd;">EXCEL ANALYSIS AND INSIGHTS</h1>""")8 unmodified linesout1=gr.File(label="Download CSV")gr.HTML(value="""<h2 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h2>""")out2=gr.File(label="Download CSV")sheet_dropdown = gr.Dropdown(label="Select sheet", options=[], disabled=True # Initially disabled)with gr.Column()gr.HTML(value="""<h2 style="color: #BA4A00; text-shadow: 1px 1px 2px #ddd;"COLUMNS IN FILE</h2>"""):#gr.Markdown("***Uploaded File***")6 unmodified linesgr.HTML(value="""<h2 style="color: #BA4A00; text-shadow: 1px 1px 2px #ddd;"COLUMNS STATS AND ANALYSIS</h2>"""):#gr.Markdown("#Columns Analysis")dataframe2=gr.Dataframe()btn.click(handle_click, inputs=[file, sheet_dropdown], outputs=[out1, out2, var, dataframe1, dataframe2])file.observe(update_sheets, names=["data"])#btn.click(generate_report,inputs=[file],outputs=[out1,out2,var,dataframe1,dataframe2])cluster.launch()
app.py+18-2