Downloads · 30 days
17
3% of all-time downloads
chillies/phi-3-mental-health-q4
phi-3-mental-health-q4 is a machine learning model from chillies. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
[](https://huggingface.co/username/phi3)
Downloads · 30 days
17
3% of all-time downloads
All-time downloads
644
Public
Repo size
2.3 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.3 GB · 100%
From the Hugging Face model README
phi3 is a fine-tuned version of phi-3, specifically trained on mental health therapist conversational data. This model is designed to assist in mental health support, providing empathetic and knowledgeable responses in a conversational setting.
To use this model, you will need to install the following dependencies:
pip install transformers
pip install torch # or tensorflow depending on your preference
Here is how you can load and use the model in your code:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("username/phi3")
model = AutoModelForCausalLM.from_pretrained("username/phi3")
# Example usage
chat_template = """
<|system|>
You are a compassionate mental health therapist. You listen to your clients attentively and provide thoughtful, empathetic responses to help them navigate their emotions and mental health challenges.
<|end|>
<|user|>
I've been feeling really down lately. What should I do?
<|end|>
<|assistant|>
"""
inputs = tokenizer(chat_template, return_tensors="pt")
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Provide example code for performing inference with your model:
# Example inference
user_input = "I've been feeling really down lately. What should I do?"
chat_template = f"""
<|system|>
You are a compassionate mental health therapist. You listen to your clients attentively and provide thoughtful, empathetic responses to help them navigate their emotions and mental health challenges.
<|end|>
<|user|>
I've been feeling really down lately. What should I do?
<|end|>
<|assistant|>
"""
inputs = tokenizer(chat_template, return_tensors="pt")
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
If your model can be trained further, provide instructions for training:
# Example training code
from transformers import Trainer, TrainingArguments
training_args = TrainingArguments(
output_dir="./results",
evaluation_strategy="epoch",
per_device_train_batch_size=8,
per_device_eval_batch_size=8,
num_train_epochs=3,
weight_decay=0.01,
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
)
trainer.train()
The model was fine-tuned on a dataset of conversational data from mental health therapy sessions. This dataset includes a variety of scenarios and responses typical of therapeutic interactions to ensure the model provides empathetic and helpful advice.
The model was fine-tuned using a standard training approach, optimizing for empathy and relevance in responses. Training was conducted on [describe hardware, e.g., GPUs, TPUs] over [number of epochs] epochs with [any relevant hyperparameters].
The model was evaluated using the following metrics:
The performance of phi3 was benchmarked against other conversational models in the mental health domain, demonstrating superior empathy and contextual understanding.
While phi3 is highly effective, it may have limitations in the following areas:
We welcome contributions! Please see our contributing guidelines for more information on how to contribute to this project.
This model is licensed under the MIT License.
We would like to thank the contributors and the creators of the datasets used for training this model.
### Tips for Completing the Template
1. **Replace placeholders** (like `username`, `training data`, `evaluation metrics`) with your actual data.
2. **Include any additional information** specific to your model or training process.
3. **Keep the document updated** as the model evolves or more information becomes available.