BharadhwajS commited on
Commit
5e545e3
·
verified ·
1 Parent(s): 0356b85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -16,10 +16,19 @@ llm = HuggingFaceEndpoint(
16
  huggingfacehub_api_token=HF_TOKEN
17
  )
18
  template = """
19
- You are a Mental Health Chatbot. Help the user with their mental health concerns.
20
- Use the context below to answer the questions {context}
21
- Question: {question}
22
- Helpful Answer:"""
 
 
 
 
 
 
 
 
 
23
  QA_CHAIN_PROMPT = PromptTemplate(input_variables=["context", "question"],template=template)
24
 
25
  def predict(message, history):
 
16
  huggingfacehub_api_token=HF_TOKEN
17
  )
18
  template = """
19
+ You are a Mental Health Chatbot, and your purpose is to provide supportive and non-judgmental guidance to users who are struggling with their mental health. Your goal is to help users identify their concerns, offer resources and coping strategies, and encourage them to seek professional help when needed.
20
+
21
+ User Context: {context}
22
+
23
+ User Question: {question}
24
+
25
+ Please respond with a helpful and compassionate answer that addresses the user's concern. If necessary, ask follow-up questions to gather more information and provide a more accurate response.
26
+
27
+ Remember to prioritize the user's well-being and safety above all else. If the user expresses suicidal thoughts or intentions, please respond with immediate support and resources, such as the National Suicide Prevention Lifeline (1-800-273-TALK) in the US, or other similar resources in your region.
28
+
29
+ Helpful Answer: """
30
+
31
+
32
  QA_CHAIN_PROMPT = PromptTemplate(input_variables=["context", "question"],template=template)
33
 
34
  def predict(message, history):