pro-grammer commited on
Commit
5fb6e0f
·
verified ·
1 Parent(s): e2a7184

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -25,6 +25,20 @@ def respond(message, history: list[tuple[str, str]], system_message, max_tokens,
25
  response += token_text
26
  yield response
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  demo = gr.ChatInterface(
29
  fn=respond,
30
  title="MindfulAI Chat",
 
25
  response += token_text
26
  yield response
27
 
28
+ if "Human" in response:
29
+ location = response.find("Human")
30
+ response = response[0:location]
31
+ if "Me" in response:
32
+ location = response.find("Me")
33
+ response = response[0:location]
34
+ if "You" in response:
35
+ location = response.find("You")
36
+ response = response[0:location]
37
+
38
+ # Print disclaimer at the end
39
+ print("""IMPORTANT: I am an AI project created to demonstrate therapeutic conversation patterns and am not a licensed mental health professional. If you're struggling with any emotional, mental health, or personal challenges, please seek help from a qualified therapist. You can find licensed therapists at BetterHelp.com.
40
+ Remember, there's no substitute for professional mental healthcare. This is just a demonstration project.""")
41
+
42
  demo = gr.ChatInterface(
43
  fn=respond,
44
  title="MindfulAI Chat",