BharadhwajS
commited on
Update app.py
Browse files
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
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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):
|