Files changed (1) hide show
  1. README.md +119 -106
README.md CHANGED
@@ -1,107 +1,120 @@
1
- ---
2
- language: en
3
- license: mit
4
- tags:
5
- - mental-health
6
- - therapy
7
- - llm
8
- - conversational
9
- datasets:
10
- - fadodr/mental_health_therapy
11
- base_model:
12
- - Qwen/Qwen2.5-3B
13
- ---
14
-
15
- # Dia Mental Health Assistant
16
-
17
- Dia is a compassionate mental health therapy assistant designed to provide supportive guidance on mental health topics.
18
- It responds with empathy and care, using GenZ expressions to connect authentically with users.
19
-
20
- ## Model Description
21
-
22
- This model is fine-tuned to:
23
- - Provide empathetic responses to mental health concerns
24
- - Use GenZ language to connect with users
25
- - Keep responses concise and relevant
26
- - Ask thoughtful questions to understand feelings better
27
- - Prioritize emotional wellbeing
28
-
29
- ## Usage
30
-
31
- ```python
32
- import torch
33
- from unsloth import FastLanguageModel
34
- from transformers import TextStreamer
35
-
36
- # Load model and tokenizer with Unsloth
37
- model_name = "petrioteer/dia50-2e"
38
- model, tokenizer = FastLanguageModel.from_pretrained(
39
- model_name=model_name,
40
- max_seq_length=2048,
41
- load_in_4bit=True,
42
- device_map="auto",
43
- )
44
-
45
- # Enable faster inference
46
- FastLanguageModel.for_inference(model)
47
-
48
- # Create a text streamer for continuous output
49
- text_streamer = TextStreamer(tokenizer)
50
-
51
- # Define the prompt template
52
- dia_prompt = """You are Dia, a compassionate mental health therapy assistant. Your purpose is to provide supportive guidance on mental health topics only. Respond with empathy and care, using GenZ expressions to connect authentically with users. Keep your responses concise and directly relevant to the user's input. Ask thoughtful questions to understand their feelings better. Never give medical advice or discuss non-mental health topics. Always prioritize the user's emotional wellbeing and use affirming language that validates their experiences.
53
-
54
- ### Instruction:
55
- {}
56
-
57
- ### Input:
58
- {}
59
-
60
- ### Response:
61
- """
62
-
63
- def chat_with_dia(user_input, system_prompt="You are Dia, a compassionate mental health therapy assistant. Your purpose is to provide supportive guidance on mental health topics only. Respond with empathy and care, using GenZ expressions to connect authentically with users. Keep your responses concise (2-3 sentences) and directly relevant to the user's specific question or concern. Ask thoughtful questions to understand their feelings better. Never give medical advice or discuss non-mental health topics. Always prioritize the user's emotional wellbeing and use affirming language that validates their experiences."):
64
- # Format the input using the same template as training
65
- inputs = tokenizer(
66
- [
67
- dia_prompt.format(
68
- system_prompt, # instruction
69
- user_input, # input
70
- )
71
- ],
72
- return_tensors="pt"
73
- ).to("cuda" if torch.cuda.is_available() else "cpu")
74
-
75
- # Generate response with streaming
76
- print("\nDia is responding...")
77
- _ = model.generate(
78
- **inputs,
79
- streamer=text_streamer,
80
- max_new_tokens=512,
81
- temperature=0.74,
82
- top_p=0.9,
83
- do_sample=True,
84
- )
85
- print("\n")
86
-
87
- # Simple chat loop
88
- if __name__ == "__main__":
89
- print("Welcome to Dia Chat! (Type 'exit' to quit)")
90
- print("=" * 99)
91
-
92
- while True:
93
- user_input = input("\nYou: ")
94
- if user_input.lower() in ["exit", "quit", "bye"]:
95
- print("Dia: Goodbye! Take care of yourself!")
96
- break
97
-
98
- chat_with_dia(user_input)
99
- ```
100
-
101
- ## Model Limitations
102
- - This model is designed specifically for mental health support conversations and may not perform well on other topics
103
- - It is not a replacement for professional mental health services
104
- - The model may occasionally generate responses that sound like medical advice despite being instructed not to
105
- - The model's understanding of GenZ language is limited to its training data
106
- ## Ethical Considerations
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  This model is intended to provide emotional support only and should not be used as a substitute for professional mental health care. Users should be made aware of the limitations of AI-based support systems.
 
1
+ ---
2
+ language:
3
+ - zho
4
+ - eng
5
+ - fra
6
+ - spa
7
+ - por
8
+ - deu
9
+ - ita
10
+ - rus
11
+ - jpn
12
+ - kor
13
+ - vie
14
+ - tha
15
+ - ara
16
+ license: mit
17
+ tags:
18
+ - mental-health
19
+ - therapy
20
+ - llm
21
+ - conversational
22
+ datasets:
23
+ - fadodr/mental_health_therapy
24
+ base_model:
25
+ - Qwen/Qwen2.5-3B
26
+ ---
27
+
28
+ # Dia Mental Health Assistant
29
+
30
+ Dia is a compassionate mental health therapy assistant designed to provide supportive guidance on mental health topics.
31
+ It responds with empathy and care, using GenZ expressions to connect authentically with users.
32
+
33
+ ## Model Description
34
+
35
+ This model is fine-tuned to:
36
+ - Provide empathetic responses to mental health concerns
37
+ - Use GenZ language to connect with users
38
+ - Keep responses concise and relevant
39
+ - Ask thoughtful questions to understand feelings better
40
+ - Prioritize emotional wellbeing
41
+
42
+ ## Usage
43
+
44
+ ```python
45
+ import torch
46
+ from unsloth import FastLanguageModel
47
+ from transformers import TextStreamer
48
+
49
+ # Load model and tokenizer with Unsloth
50
+ model_name = "petrioteer/dia50-2e"
51
+ model, tokenizer = FastLanguageModel.from_pretrained(
52
+ model_name=model_name,
53
+ max_seq_length=2048,
54
+ load_in_4bit=True,
55
+ device_map="auto",
56
+ )
57
+
58
+ # Enable faster inference
59
+ FastLanguageModel.for_inference(model)
60
+
61
+ # Create a text streamer for continuous output
62
+ text_streamer = TextStreamer(tokenizer)
63
+
64
+ # Define the prompt template
65
+ dia_prompt = """You are Dia, a compassionate mental health therapy assistant. Your purpose is to provide supportive guidance on mental health topics only. Respond with empathy and care, using GenZ expressions to connect authentically with users. Keep your responses concise and directly relevant to the user's input. Ask thoughtful questions to understand their feelings better. Never give medical advice or discuss non-mental health topics. Always prioritize the user's emotional wellbeing and use affirming language that validates their experiences.
66
+
67
+ ### Instruction:
68
+ {}
69
+
70
+ ### Input:
71
+ {}
72
+
73
+ ### Response:
74
+ """
75
+
76
+ def chat_with_dia(user_input, system_prompt="You are Dia, a compassionate mental health therapy assistant. Your purpose is to provide supportive guidance on mental health topics only. Respond with empathy and care, using GenZ expressions to connect authentically with users. Keep your responses concise (2-3 sentences) and directly relevant to the user's specific question or concern. Ask thoughtful questions to understand their feelings better. Never give medical advice or discuss non-mental health topics. Always prioritize the user's emotional wellbeing and use affirming language that validates their experiences."):
77
+ # Format the input using the same template as training
78
+ inputs = tokenizer(
79
+ [
80
+ dia_prompt.format(
81
+ system_prompt, # instruction
82
+ user_input, # input
83
+ )
84
+ ],
85
+ return_tensors="pt"
86
+ ).to("cuda" if torch.cuda.is_available() else "cpu")
87
+
88
+ # Generate response with streaming
89
+ print("\nDia is responding...")
90
+ _ = model.generate(
91
+ **inputs,
92
+ streamer=text_streamer,
93
+ max_new_tokens=512,
94
+ temperature=0.74,
95
+ top_p=0.9,
96
+ do_sample=True,
97
+ )
98
+ print("\n")
99
+
100
+ # Simple chat loop
101
+ if __name__ == "__main__":
102
+ print("Welcome to Dia Chat! (Type 'exit' to quit)")
103
+ print("=" * 99)
104
+
105
+ while True:
106
+ user_input = input("\nYou: ")
107
+ if user_input.lower() in ["exit", "quit", "bye"]:
108
+ print("Dia: Goodbye! Take care of yourself!")
109
+ break
110
+
111
+ chat_with_dia(user_input)
112
+ ```
113
+
114
+ ## Model Limitations
115
+ - This model is designed specifically for mental health support conversations and may not perform well on other topics
116
+ - It is not a replacement for professional mental health services
117
+ - The model may occasionally generate responses that sound like medical advice despite being instructed not to
118
+ - The model's understanding of GenZ language is limited to its training data
119
+ ## Ethical Considerations
120
  This model is intended to provide emotional support only and should not be used as a substitute for professional mental health care. Users should be made aware of the limitations of AI-based support systems.