Arnaudding001 commited on
Commit
7d36bac
Β·
1 Parent(s): e3b9cc7

Fix template loading problem

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +9 -5
src/streamlit_app.py CHANGED
@@ -129,11 +129,15 @@ with st.sidebar:
129
 
130
  c1, c2, c3 = st.columns([2, 1, 1])
131
  with c1:
132
- uploaded = st.file_uploader("πŸ“ Upload Excel Template", type=["xlsx"],
133
- help="Upload the Country Risk Profile template")
134
- if uploaded:
135
- Path("Country_Risk_profile_template.xlsx").write_bytes(uploaded.getvalue())
136
- st.session_state.template_path = "Country_Risk_profile_template.xlsx"
 
 
 
 
137
  with c2:
138
  country = st.selectbox("🌍 Country", ["India"])
139
  with c3:
 
129
 
130
  c1, c2, c3 = st.columns([2, 1, 1])
131
  with c1:
132
+ template_file = Path("Country_Risk_profile_template.xlsx")
133
+ if not template_file.exists():
134
+ template_file = Path("/app/Country_Risk_profile_template.xlsx")
135
+
136
+ if template_file.exists():
137
+ st.success("πŸ“ Template loaded: Country_Risk_profile_template.xlsx")
138
+ st.session_state.template_path = str(template_file)
139
+ else:
140
+ st.error("❌ Template file not found in deployment.")
141
  with c2:
142
  country = st.selectbox("🌍 Country", ["India"])
143
  with c3: