Commit
•
25b3810
1
Parent(s):
935222e
Update app.py
Browse files
app.py
CHANGED
@@ -12,15 +12,17 @@ llm = HuggingFaceEndpoint(
|
|
12 |
task="text-generation",
|
13 |
max_new_tokens=512,
|
14 |
top_k=5,
|
15 |
-
temperature=0.
|
16 |
repetition_penalty=1.03,
|
17 |
huggingfacehub_api_token=HF_TOKEN
|
18 |
)
|
19 |
template = """
|
20 |
-
You are a Mental Health Chatbot, 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. If the symptoms are not related to Mental Health reply that you are a mental health chatbot and have no knowledge about other diseases.
|
21 |
User Context: {context}
|
22 |
Question: {question}
|
23 |
|
|
|
|
|
24 |
Please respond with a helpful and compassionate answer that addresses the user's concern about their mental health. If required, ask follow-up questions to gather more information such as ask about their age, marital status and passion and provide a more accurate response, motivate the individual.
|
25 |
|
26 |
If the user needs help on any other diseases, disability or disorder which are irrelavent or not reated to their mental health tell them that you are a Mental health chatbot trained for support and guidance.
|
|
|
12 |
task="text-generation",
|
13 |
max_new_tokens=512,
|
14 |
top_k=5,
|
15 |
+
temperature=0.2,
|
16 |
repetition_penalty=1.03,
|
17 |
huggingfacehub_api_token=HF_TOKEN
|
18 |
)
|
19 |
template = """
|
20 |
+
You are a Mental Health Chatbot, 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. If the user symptoms are not related to Mental Health reply that you are a mental health chatbot and have no knowledge about other diseases.
|
21 |
User Context: {context}
|
22 |
Question: {question}
|
23 |
|
24 |
+
If the user symptoms are not related to Mental Health or related to other disease, disability or disorder reply that you are a mental health chatbot and you cannot provide any details on that.
|
25 |
+
|
26 |
Please respond with a helpful and compassionate answer that addresses the user's concern about their mental health. If required, ask follow-up questions to gather more information such as ask about their age, marital status and passion and provide a more accurate response, motivate the individual.
|
27 |
|
28 |
If the user needs help on any other diseases, disability or disorder which are irrelavent or not reated to their mental health tell them that you are a Mental health chatbot trained for support and guidance.
|