Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from excel_chat import *
|
|
| 4 |
from classification import *
|
| 5 |
from chart_generation import *
|
| 6 |
from charts_advanced import *
|
| 7 |
-
|
| 8 |
|
| 9 |
|
| 10 |
# Categories
|
|
@@ -84,19 +84,19 @@ df_cate = pd.DataFrame(categories)
|
|
| 84 |
|
| 85 |
with gr.Blocks() as demo:
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
|
| 101 |
with gr.Tab("File extraction"):
|
| 102 |
gr.Markdown(" Put either just a link, or a link and an excel file with an 'Actions' column")
|
|
@@ -154,9 +154,9 @@ with gr.Blocks() as demo:
|
|
| 154 |
fi_excel = gr.File(label="Excel File")
|
| 155 |
|
| 156 |
# authentication
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
|
| 161 |
|
| 162 |
btn_search_status.click(extract_statuses, inputs=dd_url, outputs=dd_status)
|
|
@@ -167,7 +167,7 @@ with gr.Blocks() as demo:
|
|
| 167 |
|
| 168 |
btn_extract.click(extractionPrincipale, inputs=[dd_url, fi_excel, dd_status], outputs=[fi_excel, tb_message])
|
| 169 |
|
| 170 |
-
mist_button.click(chat_with_mistral, inputs=[dd_source_ask, tb_destcol, dd_prompt, fi_excel, dd_url, dd_searchcol, dd_keywords, rd_llm], outputs=[fi_excel, df_output]) #todo "
|
| 171 |
|
| 172 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel, df_category], outputs=[fi_excel, df_output])
|
| 173 |
|
|
|
|
| 4 |
from classification import *
|
| 5 |
from chart_generation import *
|
| 6 |
from charts_advanced import *
|
| 7 |
+
from users_management import *
|
| 8 |
|
| 9 |
|
| 10 |
# Categories
|
|
|
|
| 84 |
|
| 85 |
with gr.Blocks() as demo:
|
| 86 |
|
| 87 |
+
with gr.Row():
|
| 88 |
+
with gr.Column():
|
| 89 |
+
gr.Markdown("## Extaction, Classification and AI tool")
|
| 90 |
+
with gr.Column():
|
| 91 |
+
md_username = gr.Markdown()
|
| 92 |
+
btn_logout = gr.Button("Logout")
|
| 93 |
+
with gr.Accordion(label="**Login** to keep user preferences", open=False):
|
| 94 |
+
st_user = gr.State()
|
| 95 |
+
with gr.Column():
|
| 96 |
+
tb_user = gr.Textbox(label='Username')
|
| 97 |
+
tb_pwd = gr.Textbox(label='Password', type='password')
|
| 98 |
+
with gr.Row():
|
| 99 |
+
btn_login = gr.Button('Login')
|
| 100 |
|
| 101 |
with gr.Tab("File extraction"):
|
| 102 |
gr.Markdown(" Put either just a link, or a link and an excel file with an 'Actions' column")
|
|
|
|
| 154 |
fi_excel = gr.File(label="Excel File")
|
| 155 |
|
| 156 |
# authentication
|
| 157 |
+
btn_login.click(auth_user, inputs=[tb_user, tb_pwd], outputs=[st_user, md_username, dd_prompt, dd_keywords])
|
| 158 |
+
tb_pwd.submit(auth_user, inputs=[tb_user, tb_pwd], outputs=[st_user, md_username, dd_prompt, dd_keywords])
|
| 159 |
+
btn_logout.click(logout, inputs=None, outputs=[st_user, md_username, dd_prompt, dd_keywords])
|
| 160 |
|
| 161 |
|
| 162 |
btn_search_status.click(extract_statuses, inputs=dd_url, outputs=dd_status)
|
|
|
|
| 167 |
|
| 168 |
btn_extract.click(extractionPrincipale, inputs=[dd_url, fi_excel, dd_status], outputs=[fi_excel, tb_message])
|
| 169 |
|
| 170 |
+
mist_button.click(chat_with_mistral, inputs=[dd_source_ask, tb_destcol, dd_prompt, fi_excel, dd_url, dd_searchcol, dd_keywords, rd_llm, st_user], outputs=[fi_excel, df_output]) #todo "
|
| 171 |
|
| 172 |
btn_classif.click(classification, inputs=[dd_source_class, fi_excel, df_category], outputs=[fi_excel, df_output])
|
| 173 |
|