Spaces:
Running
Running
phyloforfun
commited on
Commit
·
32f1ba8
1
Parent(s):
fc7f534
file upload gallery
Browse files
app.py
CHANGED
@@ -1463,11 +1463,18 @@ def render_expense_report_summary():
|
|
1463 |
st.error('No expense report data available.')
|
1464 |
|
1465 |
def sidebar_content():
|
1466 |
-
|
1467 |
validate_dir(os.path.join(st.session_state.dir_home,'expense_report'))
|
1468 |
-
|
|
|
|
|
|
|
|
|
1469 |
render_expense_report_summary()
|
1470 |
-
|
|
|
|
|
|
|
1471 |
st.header('Expense Report Summary')
|
1472 |
st.write('Available after first run...')
|
1473 |
st.write('Google PaLM 2 is not tracked since it is currently free.')
|
|
|
1463 |
st.error('No expense report data available.')
|
1464 |
|
1465 |
def sidebar_content():
|
1466 |
+
if not os.path.exists(os.path.join(st.session_state.dir_home,'expense_report')):
|
1467 |
validate_dir(os.path.join(st.session_state.dir_home,'expense_report'))
|
1468 |
+
expense_report_path = os.path.join(st.session_state.dir_home, 'expense_report', 'expense_report.csv')
|
1469 |
+
|
1470 |
+
if os.path.exists(expense_report_path):
|
1471 |
+
# File exists, proceed with summarization
|
1472 |
+
st.session_state.expense_summary, st.session_state.expense_report = summarize_expense_report(expense_report_path)
|
1473 |
render_expense_report_summary()
|
1474 |
+
else:
|
1475 |
+
# File does not exist, handle this case appropriately
|
1476 |
+
# For example, you could set the session state variables to None or an empty value
|
1477 |
+
st.session_state.expense_summary, st.session_state.expense_report = None, None
|
1478 |
st.header('Expense Report Summary')
|
1479 |
st.write('Available after first run...')
|
1480 |
st.write('Google PaLM 2 is not tracked since it is currently free.')
|