Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -2
src/streamlit_app.py
CHANGED
|
@@ -926,14 +926,16 @@ with tabs[9]:
|
|
| 926 |
# -------------------------
|
| 927 |
# 3. Role selection and contextual info
|
| 928 |
# -------------------------
|
| 929 |
-
role = st.selectbox("Select Your Role", list(roles.keys()), index=10)
|
|
|
|
|
|
|
| 930 |
st.caption(f" Context: {roles[role]}")
|
| 931 |
|
| 932 |
if not recs:
|
| 933 |
st.warning("Please run the AutoML + SHAP step first to generate recommendations.")
|
| 934 |
else:
|
| 935 |
generate_clicked = st.button("Generate Role-Based Advisory")
|
| 936 |
-
if generate_clicked
|
| 937 |
st.session_state["hf_ran_once"] = True
|
| 938 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 939 |
if not HF_TOKEN:
|
|
|
|
| 926 |
# -------------------------
|
| 927 |
# 3. Role selection and contextual info
|
| 928 |
# -------------------------
|
| 929 |
+
role = st.selectbox("Select Your Role", list(roles.keys()), index=10, key="selected_role")
|
| 930 |
+
if "last_role" in st.session_state and st.session_state["last_role"] != role:
|
| 931 |
+
st.session_state["hf_ran_once"] = False
|
| 932 |
st.caption(f" Context: {roles[role]}")
|
| 933 |
|
| 934 |
if not recs:
|
| 935 |
st.warning("Please run the AutoML + SHAP step first to generate recommendations.")
|
| 936 |
else:
|
| 937 |
generate_clicked = st.button("Generate Role-Based Advisory")
|
| 938 |
+
if generate_clicked:
|
| 939 |
st.session_state["hf_ran_once"] = True
|
| 940 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 941 |
if not HF_TOKEN:
|