zementalist commited on
Commit
46612b9
1 Parent(s): 3c9c44b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +149 -136
README.md CHANGED
@@ -1,201 +1,214 @@
1
  ---
2
  library_name: transformers
3
  tags:
4
- - trl
5
- - sft
 
 
 
 
 
 
 
 
 
 
6
  ---
7
 
8
  # Model Card for Model ID
9
 
10
  <!-- Provide a quick summary of what the model is/does. -->
 
 
11
 
 
12
 
13
 
14
  ## Model Details
15
 
16
- ### Model Description
17
 
18
- <!-- Provide a longer summary of what this model is. -->
 
 
 
 
19
 
20
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
 
21
 
22
- - **Developed by:** [More Information Needed]
23
- - **Funded by [optional]:** [More Information Needed]
24
- - **Shared by [optional]:** [More Information Needed]
25
- - **Model type:** [More Information Needed]
26
- - **Language(s) (NLP):** [More Information Needed]
27
- - **License:** [More Information Needed]
28
- - **Finetuned from model [optional]:** [More Information Needed]
29
 
30
- ### Model Sources [optional]
31
 
32
- <!-- Provide the basic links for the model. -->
33
 
34
- - **Repository:** [More Information Needed]
35
- - **Paper [optional]:** [More Information Needed]
36
- - **Demo [optional]:** [More Information Needed]
37
-
38
- ## Uses
39
-
40
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
41
-
42
- ### Direct Use
43
-
44
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
45
-
46
- [More Information Needed]
47
-
48
- ### Downstream Use [optional]
49
 
50
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
51
 
52
- [More Information Needed]
53
 
54
- ### Out-of-Scope Use
 
55
 
56
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
57
 
58
- [More Information Needed]
 
 
 
59
 
60
- ## Bias, Risks, and Limitations
 
 
 
 
61
 
62
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
63
 
64
- [More Information Needed]
 
 
 
65
 
66
- ### Recommendations
 
 
 
 
 
 
 
 
67
 
68
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
69
 
70
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
71
 
72
- ## How to Get Started with the Model
73
 
74
- Use the code below to get started with the model.
75
 
76
- [More Information Needed]
77
 
78
  ## Training Details
79
 
80
  ### Training Data
81
 
82
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
83
-
84
- [More Information Needed]
85
-
86
- ### Training Procedure
87
-
88
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
89
-
90
- #### Preprocessing [optional]
91
-
92
- [More Information Needed]
93
 
94
 
95
  #### Training Hyperparameters
96
 
97
  - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
98
 
99
- #### Speeds, Sizes, Times [optional]
100
-
101
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
102
-
103
- [More Information Needed]
 
 
104
 
105
  ## Evaluation
106
 
107
  <!-- This section describes the evaluation protocols and provides the results. -->
108
 
109
- ### Testing Data, Factors & Metrics
110
-
111
- #### Testing Data
112
 
113
- <!-- This should link to a Dataset Card if possible. -->
114
 
115
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- #### Factors
118
 
119
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
120
-
121
- [More Information Needed]
122
-
123
- #### Metrics
124
-
125
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
126
-
127
- [More Information Needed]
128
 
129
  ### Results
130
 
131
- [More Information Needed]
132
-
133
- #### Summary
134
-
135
-
136
-
137
- ## Model Examination [optional]
138
-
139
- <!-- Relevant interpretability work for the model goes here -->
140
-
141
- [More Information Needed]
142
-
143
- ## Environmental Impact
144
-
145
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
146
-
147
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
148
-
149
- - **Hardware Type:** [More Information Needed]
150
- - **Hours used:** [More Information Needed]
151
- - **Cloud Provider:** [More Information Needed]
152
- - **Compute Region:** [More Information Needed]
153
- - **Carbon Emitted:** [More Information Needed]
154
-
155
- ## Technical Specifications [optional]
156
-
157
- ### Model Architecture and Objective
158
-
159
- [More Information Needed]
160
-
161
- ### Compute Infrastructure
162
-
163
- [More Information Needed]
164
-
165
- #### Hardware
166
-
167
- [More Information Needed]
168
-
169
- #### Software
170
-
171
- [More Information Needed]
172
-
173
- ## Citation [optional]
174
-
175
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
176
-
177
- **BibTeX:**
178
-
179
- [More Information Needed]
180
-
181
- **APA:**
182
-
183
- [More Information Needed]
184
 
185
- ## Glossary [optional]
186
 
187
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
188
 
189
- [More Information Needed]
190
 
191
- ## More Information [optional]
192
 
193
- [More Information Needed]
 
 
 
194
 
195
- ## Model Card Authors [optional]
 
 
 
 
196
 
197
- [More Information Needed]
198
 
199
- ## Model Card Contact
200
 
201
- [More Information Needed]
 
1
  ---
2
  library_name: transformers
3
  tags:
4
+ - SFT
5
+ - PEFT
6
+ - Mental Health
7
+ - Psychotherapy
8
+ - Fine-tuning
9
+ - Text Generation
10
+ - Chatbo
11
+ license: mit
12
+ datasets:
13
+ - mpingale/mental-health-chat-dataset
14
+ - Amod/mental_health_counseling_conversations
15
+ - heliosbrahma/mental_health_chatbot_dataset
16
  ---
17
 
18
  # Model Card for Model ID
19
 
20
  <!-- Provide a quick summary of what the model is/does. -->
21
+ A fine-tuned Llama-3-8B-instruct trained to provide initial support and guidance in mental health by leveraging the power of large language models (LLMs).
22
+ It's a fine-tuned version of the LLaMA 3 model specifically trained on mental health counseling conversations.
23
 
24
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/65f2cc4457fbd3c9fb65b34c/ujViqdS9zgW-IrEFbAKLw.jpeg)
25
 
26
 
27
  ## Model Details
28
 
29
+ Llama-3-8B-chat-psychotherapist
30
 
31
+ Provides active listening: The model is trained to follow conversation flows and respond attentively to user expressions.
32
+ Offers empathetic support: The model's responses are designed to be supportive and understanding, fostering a safe space for users to share their concerns.
33
+ Guides users towards self-reflection: The model can ask open-ended questions and prompt users to explore their thoughts and feelings.
34
+ Offers resources and information: Depending on the conversation, the model can provide users with relevant mental health resources and information.
35
+ Important to Note:
36
 
37
+ **This model is intended for initial support and guidance, not a replacement for professional mental health care.
38
+ It's crucial to emphasize that users should seek professional help if needed.
39
+ The model is still under development, and its responses may require human oversight for accuracy and safety.**
40
 
41
+ Further Considerations:
42
+ You can specify the type of mental health conversations the model is trained on (e.g., anxiety, depression, general well-being).
43
+ Briefly mention the dataset used for fine-tuning to showcase the model's training grounds.
44
+ If applicable, mention any limitations of the model, such as inability to diagnose or provide specific treatment plans.
 
 
 
45
 
 
46
 
 
47
 
48
+ ## How to Get Started with the Model
49
+ Use the code below to get started with the model.
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
+ ```
52
 
53
+ from transformers import AutoTokenizer, AutoModel
54
 
55
+ tokenizer = AutoTokenizer.from_pretrained("zementalist/llama-3-8B-chat-psychotherapist")
56
+ model = AutoModel.from_pretrained("zementalist/llama-3-8B-chat-psychotherapist")
57
 
58
+ dialogue = "I feel like I don't exist and my body is not my own, I'm sombody else observing me, what causes these ideas?"
59
 
60
+ messages = [
61
+ {"role": "system", "content": "Reply to the following inquiry:"},
62
+ {"role": "user", "content": dialogue}
63
+ ]
64
 
65
+ input_ids = tokenizer.apply_chat_template(
66
+ messages,
67
+ add_generation_prompt=True,
68
+ return_tensors="pt"
69
+ ).to(model.device)
70
 
 
71
 
72
+ terminators = [
73
+ tokenizer.eos_token_id,
74
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
75
+ ]
76
 
77
+ outputs = model.generate(
78
+ input_ids,
79
+ max_new_tokens=256,
80
+ eos_token_id=terminators,
81
+ do_sample=True,
82
+ temperature=0.01
83
+ )
84
+ response = outputs[0][input_ids.shape[-1]:]
85
+ output = tokenizer.decode(response, skip_special_tokens=True)
86
 
 
87
 
88
+ print(output)
89
 
90
+ ```
91
 
 
92
 
 
93
 
94
  ## Training Details
95
 
96
  ### Training Data
97
 
98
+ 1. [Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations)
99
+ 2. [mpingale/mental-health-chat-dataset](https://huggingface.co/datasets/mpingale/mental-health-chat-dataset)
100
+ 3. [heliosbrahma/mental_health_chatbot_dataset](https://huggingface.co/datasets/heliosbrahma/mental_health_chatbot_dataset)
 
 
 
 
 
 
 
 
101
 
102
 
103
  #### Training Hyperparameters
104
 
105
  - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
106
 
107
+ * epochs: 2
108
+ * learning rate: 6e-5
109
+ * learning rate scheduler type: constant
110
+ * Warmup ratio: 0.03
111
+ * optimizer: paged_adamw_32bit
112
+ * weight_decay: 0.001
113
+ * fp16: True
114
 
115
  ## Evaluation
116
 
117
  <!-- This section describes the evaluation protocols and provides the results. -->
118
 
 
 
 
119
 
 
120
 
121
+ | **Step** | **Training Loss** |
122
+ |---------|-------------------|
123
+ | 100 | 2.637700 |
124
+ | 200 | 2.350900 |
125
+ | 300 | 2.234500 |
126
+ | 400 | 2.230800 |
127
+ | 500 | 2.194900 |
128
+ | 600 | 2.041100 |
129
+ | 700 | 2.033800 |
130
+ | 800 | 1.988600 |
131
+ | 900 | 1.898900 |
132
+ | 1000 | 1.823600 |
133
+ | 1100 | 1.943700 |
134
+ | 1200 | 1.789900 |
135
+ | 1300 | 1.840700 |
136
+ | 1400 | 1.760900 |
137
+ | 1500 | 1.718400 |
138
+ | 1600 | 1.725600 |
139
+ | 1700 | 1.717600 |
140
+ | 1800 | 1.628200 |
141
+ | 1900 | 1.693300 |
142
+ | 2000 | 1.535600 |
143
+ | 2100 | 1.630100 |
144
+ | 2200 | 1.592300 |
145
+ | 2300 | 1.628400 |
146
+ | 2400 | 1.462500 |
147
+ | 2500 | 1.504500 |
148
+ | 2600 | 1.517500 |
149
+ | 2700 | 1.375100 |
150
+ | 2800 | 1.452800 |
151
+ | 2900 | 1.527200 |
152
+ | 3000 | 1.418600 |
153
+ | 3100 | 1.437700 |
154
+ | 3200 | 1.247900 |
155
+ | 3300 | 1.134900 |
156
+ | 3400 | 1.283800 |
157
+ | 3500 | 1.378600 |
158
+ | 3600 | 1.114600 |
159
+ | 3700 | 1.300900 |
160
+ | 3800 | 1.225700 |
161
+ | 3900 | 1.190000 |
162
+ | 4000 | 1.260200 |
163
+ | 4100 | 1.053300 |
164
+ | 4200 | 1.173000 |
165
+ | 4300 | 1.275900 |
166
+ | 4400 | 1.079800 |
167
+ | 4500 | 1.121100 |
168
+ | 4600 | 1.043100 |
169
+ | 4700 | 1.121000 |
170
+ | 4800 | 1.087200 |
171
+ | 4900 | 1.102400 |
172
+ | 5000 | 1.126100 |
173
+ | 5100 | 1.182200 |
174
+ | 5200 | 1.156500 |
175
+ | 5300 | 0.979700 |
176
+ | 5400 | 1.145300 |
177
+ | 5500 | 1.018100 |
178
+ | 5600 | 1.070500 |
179
+ | 5700 | 0.954900 |
180
+ | 5800 | 1.074200 |
181
+ | 5900 | 1.022800 |
182
+ | 6000 | 1.037700 |
183
+ | 6100 | 0.913400 |
184
+ | 6200 | 0.929500 |
185
 
 
186
 
 
 
 
 
 
 
 
 
 
187
 
188
  ### Results
189
 
190
+ 1. Question: I feel like I don't exist and my body is not my own,
191
+ like if I'm sombody else observin me, what could be this disorder?
192
+ * * Answer: You're describing a phenomenon called depersonalization. It's a common symptom of anxiety disorders, post-traumatic stress disorder (PTSD), and other mental health conditions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
 
194
+ Depersonalization can make you feel like you're observing yourself from the outside, like you're watching a movie or reading a book about yourself. You might also feel like you're not in control of your body or that you're just a puppet.
195
 
196
+ This feeling can be very distressing and can make you wonder if you're even alive. It's a very disorienting and unsettling experience.
197
 
198
+ If you're experiencing depersonalization, it's important to seek help from a mental health professional. They can help you identify the underlying causes of your feelings and develop coping strategies to manage them.
199
 
 
200
 
201
+ 2. Question: I'm always confused when making decisions, I cannot choose one option,
202
+ I must have only one option so I can make a decision, what are the causes of being
203
+ indecisive?
204
+ * * Answer: Indecisiveness is a common phenomenon that many people experience. It's not a mental health condition, but it can be frustrating and time-consuming. Here are some possible causes of indecisiveness:
205
 
206
+ 1. Fear of making the wrong decision: Sometimes, people are afraid of making the wrong choice, which can lead to indecisiveness. This fear can be due to various factors such as fear of failure, fear of rejection, or fear of the unknown.
207
+ 2. Lack of clear goals: When people don't have clear goals, they can be indecisive. This is because they don't know what they want, which can lead to confusion and indecisiveness.
208
+ 3. Overthinking: Overthinking can be a major cause of indecisiveness. When people overthink, they can get caught up in their thoughts and be unable to make a decision.
209
+ 4. Lack of self-confidence: People who lack self-confidence can be indecisive. This is because they don't believe in themselves and are afraid of making the wrong decision.
210
+ 5. Avoidance: Avoiding a decision can be a cause of indecisiveness. When people avoid making a decision, they can be indecisive because they don't know
211
 
 
212
 
 
213
 
214
+ - **Developed by:** [Zeyad Khalid]