Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import pandas as pd
|
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
from openpyxl import Workbook
|
| 5 |
from io import BytesIO
|
|
|
|
| 6 |
import re
|
| 7 |
|
| 8 |
def parse_assumptions(assumptions_text):
|
|
@@ -151,7 +152,9 @@ def generate_financials(assumptions_text):
|
|
| 151 |
cf_df.to_excel(writer, sheet_name='Sheet2', index=False)
|
| 152 |
|
| 153 |
print("Excel file 'output.xlsx' created with two sheets.")
|
| 154 |
-
|
|
|
|
|
|
|
| 155 |
return 'financial_projections.xlsx', f"data:image/png;base64,{pl_chart_base64}", f"data:image/png;base64,{cf_chart_base64}"
|
| 156 |
|
| 157 |
# Gradio interface
|
|
|
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
from openpyxl import Workbook
|
| 5 |
from io import BytesIO
|
| 6 |
+
import base64
|
| 7 |
import re
|
| 8 |
|
| 9 |
def parse_assumptions(assumptions_text):
|
|
|
|
| 152 |
cf_df.to_excel(writer, sheet_name='Sheet2', index=False)
|
| 153 |
|
| 154 |
print("Excel file 'output.xlsx' created with two sheets.")
|
| 155 |
+
|
| 156 |
+
# Generate charts
|
| 157 |
+
pl_chart_base64, cf_chart_base64 = generate_charts(pl_df, cf_df)
|
| 158 |
return 'financial_projections.xlsx', f"data:image/png;base64,{pl_chart_base64}", f"data:image/png;base64,{cf_chart_base64}"
|
| 159 |
|
| 160 |
# Gradio interface
|