Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,10 @@ from classification import *
|
|
5 |
from chart_generation import *
|
6 |
|
7 |
|
|
|
|
|
|
|
|
|
8 |
with gr.Blocks() as demo:
|
9 |
gr.Markdown("## Extaction, Classification and AI tool")
|
10 |
with gr.Tab("File extraction"):
|
@@ -26,7 +30,9 @@ with gr.Blocks() as demo:
|
|
26 |
|
27 |
with gr.Tab("Charts Generation"):
|
28 |
gr.Markdown("## Deeper Analysis coming soon...")
|
29 |
-
|
|
|
|
|
30 |
btn_chart = gr.Button("Generate Bar Plot")
|
31 |
plt_figure = gr.Plot()
|
32 |
|
@@ -35,11 +41,12 @@ with gr.Blocks() as demo:
|
|
35 |
|
36 |
fi_excel = gr.File(label="Excel File")
|
37 |
|
38 |
-
fi_excel.change(get_columns, inputs=[fi_excel], outputs=[dd_source_ask, dd_source_class,
|
39 |
btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, tb_status_message])
|
40 |
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])
|
41 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel], outputs=[fi_excel, df_output])
|
42 |
btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label], outputs=[plt_figure])
|
|
|
43 |
|
44 |
|
45 |
demo.launch(debug=True)
|
|
|
5 |
from chart_generation import *
|
6 |
|
7 |
|
8 |
+
# def update_label(label1):
|
9 |
+
# return gr.update(choices=list(df.columns))
|
10 |
+
|
11 |
+
|
12 |
with gr.Blocks() as demo:
|
13 |
gr.Markdown("## Extaction, Classification and AI tool")
|
14 |
with gr.Tab("File extraction"):
|
|
|
30 |
|
31 |
with gr.Tab("Charts Generation"):
|
32 |
gr.Markdown("## Deeper Analysis coming soon...")
|
33 |
+
with gr.Row():
|
34 |
+
dd_label1 = gr.Dropdown(label="Source Column", multiselect=False)
|
35 |
+
dd_label2 = gr.Dropdown(label="Source Column", multiselect=False)
|
36 |
btn_chart = gr.Button("Generate Bar Plot")
|
37 |
plt_figure = gr.Plot()
|
38 |
|
|
|
41 |
|
42 |
fi_excel = gr.File(label="Excel File")
|
43 |
|
44 |
+
fi_excel.change(get_columns, inputs=[fi_excel], outputs=[dd_source_ask, dd_source_class, dd_label1, dd_label2, df_output])
|
45 |
btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, tb_status_message])
|
46 |
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])
|
47 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel], outputs=[fi_excel, df_output])
|
48 |
btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label], outputs=[plt_figure])
|
49 |
+
# dd_label1.change(update_label, inputs=[dd_label1], outputs=[dd_label2])
|
50 |
|
51 |
|
52 |
demo.launch(debug=True)
|