Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -80,7 +80,7 @@ def chat_with_bot(input_text, history, conversation_times, valence_scores, arous
|
|
80 |
valence, arousal, conversation_times, valence_scores, arousal_scores = analyze_sentiment_corpus(input_text, conversation_times, valence_scores, arousal_scores)
|
81 |
|
82 |
# 判斷是否建議放鬆練習
|
83 |
-
if 4.
|
84 |
time.sleep(1.5)
|
85 |
response = "我知道你的狀況了\n我有一個建議,我們來進行一個可以讓自己放鬆的呼吸練習好嗎?"
|
86 |
history.append((input_text, response))
|
@@ -169,7 +169,7 @@ def chat_about_image(input_text, history, selected_image):
|
|
169 |
gr.update(visible=True) # chatbot_interface
|
170 |
)
|
171 |
|
172 |
-
audio_file = "
|
173 |
|
174 |
# UI handle functions
|
175 |
def handle_chat(input_text, history, conversation_times, valence_scores, arousal_scores, meditation_flag):
|
|
|
80 |
valence, arousal, conversation_times, valence_scores, arousal_scores = analyze_sentiment_corpus(input_text, conversation_times, valence_scores, arousal_scores)
|
81 |
|
82 |
# 判斷是否建議放鬆練習
|
83 |
+
if 4.7 <= arousal <= 5.4 and meditation_flag is True: # 詢問是否進行放鬆練習
|
84 |
time.sleep(1.5)
|
85 |
response = "我知道你的狀況了\n我有一個建議,我們來進行一個可以讓自己放鬆的呼吸練習好嗎?"
|
86 |
history.append((input_text, response))
|
|
|
169 |
gr.update(visible=True) # chatbot_interface
|
170 |
)
|
171 |
|
172 |
+
audio_file = "meditation_v2.m4a"
|
173 |
|
174 |
# UI handle functions
|
175 |
def handle_chat(input_text, history, conversation_times, valence_scores, arousal_scores, meditation_flag):
|