loge-dot
commited on
Commit
Β·
c49fa9d
1
Parent(s):
eca9cb0
DEBUGGING
Browse files- app.py +7 -1
- emotion_analyzer.py +7 -0
app.py
CHANGED
@@ -10,7 +10,6 @@ except RuntimeError:
|
|
10 |
|
11 |
sys.path.append(str(Path(__file__).parent))
|
12 |
|
13 |
-
|
14 |
def main():
|
15 |
st.set_page_config(
|
16 |
page_title="Audio Emotion Recognition System",
|
@@ -22,6 +21,13 @@ def main():
|
|
22 |
app_mode = st.sidebar.radio("Go to", ["Emotion Analyzer", "Chatbot"])
|
23 |
if app_mode == "Emotion Analyzer":
|
24 |
from emotion_analyzer import show # η΄ζ₯ε―Όε
₯樑ε
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
show()
|
26 |
elif app_mode == "Chatbot":
|
27 |
st.write("Chatbot is not available now, update soon...π")
|
|
|
10 |
|
11 |
sys.path.append(str(Path(__file__).parent))
|
12 |
|
|
|
13 |
def main():
|
14 |
st.set_page_config(
|
15 |
page_title="Audio Emotion Recognition System",
|
|
|
21 |
app_mode = st.sidebar.radio("Go to", ["Emotion Analyzer", "Chatbot"])
|
22 |
if app_mode == "Emotion Analyzer":
|
23 |
from emotion_analyzer import show # η΄ζ₯ε―Όε
₯樑ε
|
24 |
+
# β
ε¨ `main.py` ιεε§ε `session_state`
|
25 |
+
if "emotion_result" not in st.session_state:
|
26 |
+
st.session_state.emotion_result = None
|
27 |
+
if "feedback_submitted" not in st.session_state:
|
28 |
+
st.session_state.feedback_submitted = False
|
29 |
+
if "user_feedback" not in st.session_state:
|
30 |
+
st.session_state.user_feedback = ""
|
31 |
show()
|
32 |
elif app_mode == "Chatbot":
|
33 |
st.write("Chatbot is not available now, update soon...π")
|
emotion_analyzer.py
CHANGED
@@ -37,6 +37,13 @@ def show_history():
|
|
37 |
st.write("π« No history file.")
|
38 |
|
39 |
def show():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
st.markdown(
|
41 |
"<h1 style='text-align: center; color: #FF5733;'>π Emotion Analyzer π</h1>",
|
42 |
unsafe_allow_html=True
|
|
|
37 |
st.write("π« No history file.")
|
38 |
|
39 |
def show():
|
40 |
+
# β
εε§ε session_state δ»₯εε¨εζη»ζεει¦ηΆζ
|
41 |
+
if "emotion_result" not in st.session_state:
|
42 |
+
st.session_state.emotion_result = None
|
43 |
+
if "feedback_submitted" not in st.session_state:
|
44 |
+
st.session_state.feedback_submitted = False
|
45 |
+
if "user_feedback" not in st.session_state:
|
46 |
+
st.session_state.user_feedback = ""
|
47 |
st.markdown(
|
48 |
"<h1 style='text-align: center; color: #FF5733;'>π Emotion Analyzer π</h1>",
|
49 |
unsafe_allow_html=True
|