Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
chris1nexus
commited on
Commit
·
683a3c5
1
Parent(s):
58e1934
Update default category
Browse files- src/streamlit_app.py +2 -1
src/streamlit_app.py
CHANGED
|
@@ -280,10 +280,11 @@ with st.sidebar:
|
|
| 280 |
|
| 281 |
target_mode = st.selectbox("Target category mode", ["Pick specific", "Random each time"], index=0)
|
| 282 |
if target_mode == "Pick specific":
|
|
|
|
| 283 |
|
| 284 |
DEFAULT_CAT = "bus" # normalized label
|
| 285 |
|
| 286 |
-
if cats and DEFAULT_CAT in
|
| 287 |
default_idx = cats.index(DEFAULT_CAT)
|
| 288 |
else:
|
| 289 |
default_idx = 0 # fallback
|
|
|
|
| 280 |
|
| 281 |
target_mode = st.selectbox("Target category mode", ["Pick specific", "Random each time"], index=0)
|
| 282 |
if target_mode == "Pick specific":
|
| 283 |
+
cats = st.session_state.categories if st.session_state.categories else ["(load TSV first)"]
|
| 284 |
|
| 285 |
DEFAULT_CAT = "bus" # normalized label
|
| 286 |
|
| 287 |
+
if cats and DEFAULT_CAT in cats:
|
| 288 |
default_idx = cats.index(DEFAULT_CAT)
|
| 289 |
else:
|
| 290 |
default_idx = 0 # fallback
|