Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +11 -4
src/streamlit_app.py
CHANGED
|
@@ -88,13 +88,20 @@ def anormal(df, col_name, warning, text_input, audio_base64):
|
|
| 88 |
st.markdown(audio_html, unsafe_allow_html=True)
|
| 89 |
|
| 90 |
# ์๋น์ค ์คํ
|
| 91 |
-
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
none_temp(placeholder)
|
| 95 |
-
elif
|
| 96 |
normal(placeholder, df, "ECU_DPFSoot")
|
| 97 |
-
else:
|
| 98 |
audio_base64 = tts_engine(warning+" "+text_input)
|
| 99 |
anormal(placeholder, df, "ECU_DPFSoot", warning, text_input, audio_base64)
|
| 100 |
|
|
|
|
| 88 |
st.markdown(audio_html, unsafe_allow_html=True)
|
| 89 |
|
| 90 |
# ์๋น์ค ์คํ
|
| 91 |
+
# 1. session_state ์ด๊ธฐํ (์ฑ์ด ์ฒ์ ์คํ๋ ๋๋ง ์๋)
|
| 92 |
+
if 'selection' not in st.session_state:
|
| 93 |
+
st.session_state.selection = ""
|
| 94 |
|
| 95 |
+
st.selectbox(
|
| 96 |
+
"์ง๋จํ ๋ฐ์ดํฐ๋ฅผ ์ ํํ์ธ์:",
|
| 97 |
+
options=["", "2024-08-24", "2024-09-26"],
|
| 98 |
+
key='selection' # ์ด key๊ฐ st.session_state.selection๊ณผ ์ฐ๊ฒฐ๋ฉ๋๋ค.
|
| 99 |
+
)
|
| 100 |
+
if st.session_state.selection == "":
|
| 101 |
none_temp(placeholder)
|
| 102 |
+
elif st.session_state.selection == "2024-09-26":
|
| 103 |
normal(placeholder, df, "ECU_DPFSoot")
|
| 104 |
+
else: # "2024-08-24"
|
| 105 |
audio_base64 = tts_engine(warning+" "+text_input)
|
| 106 |
anormal(placeholder, df, "ECU_DPFSoot", warning, text_input, audio_base64)
|
| 107 |
|