File size: 1,684 Bytes
5acc5a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from config import json_url_id
from main import run_main
import gdown
import gradio as gr



download_url = f'https://drive.google.com/uc?id={json_url_id}'
output = 'secret_google_service_account.json'
gdown.download(download_url, output, quiet=False)







with gr.Blocks(title="Accountant automation",theme='nota-ai/theme') as demo:
            
    with gr.Row():
        with gr.Column(scale=6):
            with gr.Row():
                with gr.Column(scale=3):
                    source_folder_with_reciepts = gr.Textbox(placeholder="Dossier contenant les factures", lines=1)
                    link_to_csv = gr.Textbox(placeholder="Lien vers le relevé de compte en csv", lines=1, )
                    folder_to_save_processed_reciepts = gr.Textbox(placeholder="Dossier où sauvegarder les factures", lines=1, )
                    folder_to_save_reconciled_data = gr.Textbox(placeholder="Dossier où sauvegarder le tableau final", lines=1, )
                    name_output_file = gr.Textbox(placeholder="Nom du fichier de tableau final", lines=1, )
                    transaction_csv_path = gr.Textbox(placeholder="Company Name", lines=1, )
                    chat_submit_button = gr.Button(value="Submit ▶")
                    
                with gr.Column(scale=6):
                    chat_output = gr.Markdown("Appuyez sur valider pour lance le processing")

                    
    fn_chat = run_main

    
    chat_submit_button.click(fn=fn_chat, inputs=[source_folder_with_reciepts, link_to_csv, folder_to_save_processed_reciepts, folder_to_save_reconciled_data, name_output_file, transaction_csv_path], outputs=[chat_output])

demo.launch(max_threads=40)