Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,16 +22,23 @@ with gr.Blocks() as demo:
|
|
| 22 |
with gr.Tab("Classification by topic"):
|
| 23 |
dd_source_class = gr.Dropdown(label="Source Column(s)", multiselect=False)
|
| 24 |
btn_classif = gr.Button("Categorize")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
with gr.Accordion("Excel Preview", open=False):
|
| 27 |
df_output = gr.DataFrame()
|
| 28 |
|
| 29 |
fi_excel = gr.File(label="Excel File")
|
| 30 |
|
| 31 |
-
fi_excel.change(get_columns, inputs=[fi_excel], outputs=[dd_source_ask, dd_source_class, df_output])
|
| 32 |
btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, tb_status_message])
|
| 33 |
mist_button.click(chat_with_mistral, inputs=[dd_source_ask, tb_destcol, tb_prompt, tb_filename, fi_excel, tb_url], outputs=[fi_excel, df_output])
|
| 34 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel], outputs=[fi_excel, df_output])
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
demo.launch(debug=True)
|
|
|
|
| 22 |
with gr.Tab("Classification by topic"):
|
| 23 |
dd_source_class = gr.Dropdown(label="Source Column(s)", multiselect=False)
|
| 24 |
btn_classif = gr.Button("Categorize")
|
| 25 |
+
|
| 26 |
+
with gr.Tab("Charts Generation"):
|
| 27 |
+
gr.Markdown("## Deeper Analysis coming soon...")
|
| 28 |
+
dd_label = gr.Dropdown(label="Source Column", multiselect=False)
|
| 29 |
+
btn_chart = gr.Button("Generate Bar Plot")
|
| 30 |
+
plt_figure = gr.Plot()
|
| 31 |
|
| 32 |
with gr.Accordion("Excel Preview", open=False):
|
| 33 |
df_output = gr.DataFrame()
|
| 34 |
|
| 35 |
fi_excel = gr.File(label="Excel File")
|
| 36 |
|
| 37 |
+
fi_excel.change(get_columns, inputs=[fi_excel], outputs=[dd_source_ask, dd_source_class, dd_label, df_output])
|
| 38 |
btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, tb_status_message])
|
| 39 |
mist_button.click(chat_with_mistral, inputs=[dd_source_ask, tb_destcol, tb_prompt, tb_filename, fi_excel, tb_url], outputs=[fi_excel, df_output])
|
| 40 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel], outputs=[fi_excel, df_output])
|
| 41 |
+
btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label], outputs=[plt_figure])
|
| 42 |
|
| 43 |
|
| 44 |
demo.launch(debug=True)
|