Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,18 +46,21 @@ def generate_response(user_input):
|
|
46 |
)
|
47 |
response_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
48 |
|
|
|
|
|
|
|
49 |
# Add a suggestion for coping activity based on keywords in user input
|
50 |
-
if "
|
51 |
activity_suggestion = (
|
52 |
-
"
|
53 |
-
"
|
54 |
-
"
|
55 |
-
"Doing this for a few minutes can make a world of difference."
|
56 |
)
|
57 |
-
elif "
|
58 |
activity_suggestion = (
|
59 |
-
"
|
60 |
-
"
|
|
|
61 |
)
|
62 |
else:
|
63 |
activity_suggestion = (
|
|
|
46 |
)
|
47 |
response_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
48 |
|
49 |
+
# Trim the output to remove extraneous content
|
50 |
+
response_text = response_text.split("Here's something")[0].strip()
|
51 |
+
|
52 |
# Add a suggestion for coping activity based on keywords in user input
|
53 |
+
if "crying" in user_input.lower() or "overload" in user_input.lower():
|
54 |
activity_suggestion = (
|
55 |
+
"Work overload can be overwhelming, and it's completely understandable to feel like you're reaching your limit. "
|
56 |
+
"Sometimes, taking a short break can help you gain some clarity and calm your mind. "
|
57 |
+
"If possible, try stepping outside for a few minutes to breathe deeply or do some light stretching to release tension."
|
|
|
58 |
)
|
59 |
+
elif "angry" in user_input.lower() or "frustrated" in user_input.lower():
|
60 |
activity_suggestion = (
|
61 |
+
"When feeling overwhelmed, anger can sometimes mask deeper emotions like stress or exhaustion. "
|
62 |
+
"Taking deep breaths or doing a short meditation can help you ground yourself and regain focus. "
|
63 |
+
"Even small moments of calm can make a huge difference."
|
64 |
)
|
65 |
else:
|
66 |
activity_suggestion = (
|