Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,6 +90,12 @@ with gr.Blocks() as demo:
|
|
| 90 |
balance_output = gr.Textbox(label="Balance Sheet", lines=10)
|
| 91 |
|
| 92 |
def process_file(trial_balance_file, mapping_file):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
try:
|
| 94 |
mapping = load_mapping(mapping_file)
|
| 95 |
income_statement, balance_sheet = generate_financial_statements(trial_balance_file, mapping)
|
|
|
|
| 90 |
balance_output = gr.Textbox(label="Balance Sheet", lines=10)
|
| 91 |
|
| 92 |
def process_file(trial_balance_file, mapping_file):
|
| 93 |
+
# Check if files are uploaded
|
| 94 |
+
if trial_balance_file is None:
|
| 95 |
+
return "Error: Please upload a trial balance Excel file.", None
|
| 96 |
+
if mapping_file is None:
|
| 97 |
+
return "Error: Please upload a mapping file.", None
|
| 98 |
+
|
| 99 |
try:
|
| 100 |
mapping = load_mapping(mapping_file)
|
| 101 |
income_statement, balance_sheet = generate_financial_statements(trial_balance_file, mapping)
|