YchKhan commited on
Commit
6fdd23e
1 Parent(s): e12b147

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -10,28 +10,28 @@ with gr.Blocks() as demo:
10
  gr.Markdown(" Put either just a link, or a link and an excel file with an 'Actions' column")
11
  tb_url = gr.Textbox(label="URL (e.g. https://www.3gpp.org/ftp/TSG_SA/WG1_Serv/TSGS1_105_Athens/Docs)")
12
  btn_extract = gr.Button("Extract excel from URL")
13
- status_message = gr.Textbox(label="Status")
14
 
15
  with gr.Tab("Query on columns with mistral"):
16
- dd_source = gr.Dropdown(label="Source Column(s)", multiselect=True)
17
  tb_destcol = gr.Textbox(label="Destination column label (e.g. Summary, ELI5, PAB)")
18
  tb_prompt = gr.Textbox(label="Prompt")
19
  tb_filename = gr.Textbox(label="Specific File Name (Optional)")
20
  mist_button = gr.Button("Ask AI")
21
 
22
  with gr.Tab("Classification by topic"):
23
- dd_source = gr.Dropdown(label="Source Column(s)", multiselect=False)
24
- 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, df_output])
32
- btn_extract.click(extractionPrincipale, inputs=[tb_url, fi_excel], outputs=[fi_excel, status_message])
33
- mist_button.click(chat_with_mistral, inputs=[dd_source, tb_destcol, tb_prompt, tb_filename, fi_excel, tb_url], outputs=[fi_excel, df_output])
34
- classif.click(classification, inputs=[dd_source, fi_excel], outputs=[fi_excel, df_output])
35
 
36
 
37
  demo.launch(debug=True)
 
10
  gr.Markdown(" Put either just a link, or a link and an excel file with an 'Actions' column")
11
  tb_url = gr.Textbox(label="URL (e.g. https://www.3gpp.org/ftp/TSG_SA/WG1_Serv/TSGS1_105_Athens/Docs)")
12
  btn_extract = gr.Button("Extract excel from URL")
13
+ tb_status_message = gr.Textbox(label="Status")
14
 
15
  with gr.Tab("Query on columns with mistral"):
16
+ dd_source_ask = gr.Dropdown(label="Source Column(s)", multiselect=True)
17
  tb_destcol = gr.Textbox(label="Destination column label (e.g. Summary, ELI5, PAB)")
18
  tb_prompt = gr.Textbox(label="Prompt")
19
  tb_filename = gr.Textbox(label="Specific File Name (Optional)")
20
  mist_button = gr.Button("Ask AI")
21
 
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, 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)