Spaces:
Runtime error
Runtime error
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) |