Commit
•
bac7cd4
1
Parent(s):
3c2c262
Update README.md
Browse files
README.md
CHANGED
@@ -1,7 +1,68 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
### Framework versions
|
7 |
|
|
|
1 |
+
Mental Health Support Chatbot Project
|
2 |
+
This project focuses on building a Mental Health Support Chatbot using state-of-the-art technologies, including Llama 3B language model, PEFT, LORA, and 8-bit model quantization. The chatbot aims to provide empathetic and non-judgmental responses to individuals seeking mental health advice, promoting emotional well-being and support. The project comprises Data Preparation, Model Training, and Quantization of the Model.
|
3 |
+
|
4 |
+
Data Preparation
|
5 |
+
The data preparation phase involved collecting and preprocessing a dataset containing mental health conversations from various sources. The dataset consists of 6,365 rows of dialogues related to mental health. To ensure optimal training, the dataset was cleaned and formatted, removing noise, special characters, and irrelevant information.
|
6 |
+
|
7 |
+
To enhance the model's performance, data augmentation techniques were employed. Domain-specific language models were utilized to generate additional conversation examples, enabling the chatbot to respond effectively to a wider range of user queries.
|
8 |
+
|
9 |
+
Model Training
|
10 |
+
For the model training, the Llama 3B language model was chosen due to its exceptional performance in natural language understanding. The model was fine-tuned on the prepared mental health dataset using hyperparameters such as batch size, learning rate, and gradient accumulation steps. The training process aimed to optimize the model's ability to generate appropriate and supportive responses based on user prompts.
|
11 |
+
|
12 |
+
PEFT and LORA
|
13 |
+
In this project, PEFT (Parallel Efficient Transformers) and LORA (Locally Recurrent Adaptive Mechanism) techniques were incorporated to enhance the model's efficiency and performance. PEFT improves the model's scalability and training speed on multi-GPU systems. LORA, on the other hand, enhances the model's ability to capture long-range dependencies in the conversation context.
|
14 |
+
|
15 |
+
Model Quantization
|
16 |
+
Due to resource constraints, the model was quantized in 8-bit format using model quantization techniques. Quantization reduces the model size and memory footprint, making it more feasible to deploy on devices with limited resources. The chatbot achieved satisfactory performance with the quantized model, allowing it to run efficiently on systems with lower RAM and GPU capacity.
|
17 |
+
|
18 |
+
Model Training Environment
|
19 |
+
The model was trained on Google Colab, utilizing a virtual machine with 12GB CPU and 12GB T4 GPU RAM. Despite the resource limitations, the model training process yielded desirable results, demonstrating the effectiveness of the applied techniques in creating a functional and resource-efficient chatbot.
|
20 |
+
|
21 |
+
Drawbacks of Model Quantization
|
22 |
+
While 8-bit model quantization provides significant benefits in terms of model size and resource consumption, it may result in a slight decrease in the model's precision and accuracy. The quantized model might not retain the exact same performance as the full-precision model. However, for the purposes of this project and the target application, the trade-off in performance is acceptable given the hardware constraints.
|
23 |
+
|
24 |
+
How to Run the Application
|
25 |
+
To experience the Mental Health Support Chatbot application, follow these steps:
|
26 |
+
|
27 |
+
Step 1: Install the required dependencies by executing the following command in your terminal or command prompt:
|
28 |
+
|
29 |
+
pip install -r requirements.txt
|
30 |
+
Step 2: Execute the runApp.py script:
|
31 |
+
|
32 |
+
python runApp.py
|
33 |
+
Please note that the application requires a minimum system specification of 8 GB RAM and 6 GB of GPU to run efficiently.
|
34 |
+
|
35 |
+
Test Prompts
|
36 |
+
Here are some example prompts that were tested on the Mental Health Support Chatbot:
|
37 |
+
|
38 |
+
"I've been feeling really anxious lately. What should I do to cope with it?"
|
39 |
+
|
40 |
+
"I'm feeling hopeless and don't see any point in living anymore."
|
41 |
+
|
42 |
+
"I can't sleep at night, and it's affecting my daily life."
|
43 |
+
|
44 |
+
"I'm having trouble concentrating, and I feel so overwhelmed."
|
45 |
+
|
46 |
+
"My friend told me they're feeling suicidal. What can I do to help them?"
|
47 |
+
|
48 |
+
Conclusion
|
49 |
+
The Mental Health Support Chatbot project showcases the successful implementation of advanced technologies like PEFT, LORA, and 8-bit model quantization to build an efficient and supportive chatbot. While the model's quantization presents some trade-offs, it allows the chatbot to run effectively on devices with limited resources, making it accessible to a broader audience.
|
50 |
+
|
51 |
+
We encourage further exploration and improvement of the chatbot by leveraging larger and more diverse datasets and fine-tuning hyperparameters. Additionally, user feedback and continuous development will help enhance the chatbot's capabilities, providing better mental health support to users.
|
52 |
+
|
53 |
+
Finally, we express our gratitude to cofactoryai for their invaluable contribution by providing the frontend interface for the application, ensuring a user-friendly experience for the Mental Health Support Chatbot.
|
54 |
+
|
55 |
+
Note: The chatbot is not a substitute for professional mental health advice or therapy. Users with severe mental health concerns should seek help from qualified professionals.
|
56 |
+
|
57 |
+
Important Note:
|
58 |
+
|
59 |
+
Running runApp.py may take some time, depending on your internet bandwidth, because the LLaMA model and its configuration need to be downloaded. The LLaMA model is about 6GB in size, and the download time will vary based on the speed of your internet connection.
|
60 |
+
|
61 |
+
Please be patient during the download process, and ensure that you have a stable and fast internet connection to minimize the waiting time. Once the model is downloaded, subsequent runs of the application will be faster, as the model will be cached locally on your system.
|
62 |
+
|
63 |
+
If you encounter any issues during the download or if the process takes longer than expected, please check your internet connection and ensure that you have sufficient storage space on your system to accommodate the model files.
|
64 |
+
|
65 |
+
Feel free to reach out for assistance or any questions you may have during the setup and running of the application. Enjoy exploring the capabilities of the LLaMA model for Mental Health Support Chatbot!
|
66 |
|
67 |
### Framework versions
|
68 |
|