iamstrong commited on
Commit
0d4e4d1
Β·
verified Β·
1 Parent(s): 9ba6c1e

Upload 4 files

Browse files
Files changed (2) hide show
  1. app.py +18 -19
  2. calm_nature.mp3 +1 -0
app.py CHANGED
@@ -15,7 +15,8 @@ user_info = {"name": "", "age": "", "language": "english", "mood": ""}
15
  chat_history = []
16
 
17
  def welcome_screen():
18
- return "🧠 Welcome to StrongMind Therapist Pro!\nYour safe space to talk, heal, and grow."
 
19
 
20
  def set_preferences(name, age, language, mood):
21
  user_info["name"] = name
@@ -61,33 +62,31 @@ def get_therapist_reply(audio, text_input):
61
 
62
  def generate_reply(user_input):
63
  user_input = user_input.lower()
64
-
65
  if any(word in user_input for word in ["suicide", "kill", "die", "harm", "cut"]):
66
  return (
67
- "πŸ’” I believe you're very hurt, but I can't provide help in this situation.\n"
68
- "Please contact a professional therapist:\n"
69
- "πŸ“ž Dr. Meera Kapoor – +91 9876543210\n"
70
- "πŸ“ž Dr. Arjun Das – +91 9123456780\nYou are not alone πŸ’š"
 
 
 
 
71
  )
72
- if any(word in user_input for word in ["sad", "anxiety", "angry", "unwell", "hate", "stress", "depressed"]):
73
- return "It sounds like you're struggling right now. I'm here with you. Let's take it one step at a time. πŸ’–"
74
-
75
  if any(word in user_input for word in ["what should i do", "advice", "guide", "suggest"]):
76
  return (
77
- "🧠 When you're unsure, try writing down your thoughts or talking to someone you trust. "
78
- "Would you like help thinking through your options?"
79
  )
80
  if "joke" in user_input or "make me happy" in user_input:
81
- return "πŸ˜„ Why don't skeletons fight each other? Because they don't have the guts!"
82
-
83
- return "Thank you for sharing that. I'm here with you β€” feel free to say more. πŸ’¬"
84
 
85
  with gr.Blocks(css="body { background-color: #ffe6f0; }") as app:
86
- gr.Markdown("## 🌿 StrongMind Therapist Pro", elem_id="title")
87
- gr.Markdown(welcome_screen())
88
-
89
- with gr.Audio(label="🎡 Calming Music", value="calm_nature.mp3", interactive=False):
90
- pass
91
 
92
  with gr.Tab("πŸ› οΈ Start"):
93
  name = gr.Textbox(label="Your Name")
 
15
  chat_history = []
16
 
17
  def welcome_screen():
18
+ return "🧠 Welcome to StrongMind Therapist!
19
+ Your calm space to speak, heal, and grow."
20
 
21
  def set_preferences(name, age, language, mood):
22
  user_info["name"] = name
 
62
 
63
  def generate_reply(user_input):
64
  user_input = user_input.lower()
 
65
  if any(word in user_input for word in ["suicide", "kill", "die", "harm", "cut"]):
66
  return (
67
+ "πŸ’” I believe you're very hurt, but I can't provide help in this situation.
68
+ "
69
+ "Please contact a professional therapist:
70
+ "
71
+ "πŸ“ž Dr. Meera Kapoor – +91 9876543210
72
+ "
73
+ "πŸ“ž Dr. Arjun Das – +91 9123456780
74
+ You are not alone πŸ’š"
75
  )
76
+ if any(word in user_input for word in ["sad", "anxiety", "angry", "unwell", "hate", "stress"]):
77
+ return "Hey, no need to worry. I'm here for you. Just tell me more β€” we’ll figure it out together. 🧑"
 
78
  if any(word in user_input for word in ["what should i do", "advice", "guide", "suggest"]):
79
  return (
80
+ "🧠 When you're confused, take 3 deep breaths and write down small steps you can take. "
81
+ "Would you like help listing some ideas?"
82
  )
83
  if "joke" in user_input or "make me happy" in user_input:
84
+ return "πŸ˜„ Why don't scientists trust atoms? Because they make up everything!"
85
+ return "Thank you for sharing. I'm here with you. You can keep talking β€” I’m listening."
 
86
 
87
  with gr.Blocks(css="body { background-color: #ffe6f0; }") as app:
88
+ gr.Markdown("## 🌸 StrongMind Therapist with Nature Sounds")
89
+ gr.Audio(label="🎡 Calm Nature Music", value="calm_nature.mp3", interactive=False)
 
 
 
90
 
91
  with gr.Tab("πŸ› οΈ Start"):
92
  name = gr.Textbox(label="Your Name")
calm_nature.mp3 ADDED
@@ -0,0 +1 @@
 
 
1
+ FAKE_MP3_CONTENT