Downloads · 30 days
0
Tanneru/Mistral-7B-Instruct-v0.3-Mental-Health-chatbot
Mistral-7B-Instruct-v0.3-Mental-Health-chatbot is a text generation model from Tanneru. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
This is a fine-tuned version of Mistral-7B-Instruct-v0.3 for empathetic and mental-health-oriented dialogue. It has been adapted to provide supportive, safe, and context-aware responses in conversations related to men…
Downloads · 30 days
0
Access
Public
Updated Sep 1, 2025
Repo size
168 MB
Likes
1
Public
Click a slice to open those files.
.safetensors168 MB · 97%
From the Hugging Face model README
This is a fine-tuned version of Mistral-7B-Instruct-v0.3 for empathetic and mental-health-oriented dialogue.
It has been adapted to provide supportive, safe, and context-aware responses in conversations related to mental health.
Disclaimer:
This model is not a replacement for professional mental health care. It should only be used for research and educational purposes.
If you are experiencing a crisis, please seek immediate help from a qualified professional.
This model was fine-tuned on multiple open-source mental health conversation datasets:
Amod/mental_health_counseling_conversations
mpingale/mental-health-chat-dataset
heliosbrahma/mental_health_chatbot_dataset
By combining these datasets, the model learns empathetic, contextually relevant, and supportive responses.
Not intended for:
The model was evaluated using multiple NLP metrics to measure fluency, relevance, and semantic similarity:
BERTScore (F1 mean): 0.876
SBERT Cosine Similarity (mean): 0.695
ROUGE Scores:
0.3410.1350.2210.225BLEU: 0.081
chrF++: 38.05
11.322.52Lower perplexity indicates the fine-tuned model produces more coherent and predictable text compared to the base model.
These results show that fine-tuning substantially improved the model’s language generation quality, making it better aligned for empathetic and supportive mental health conversations.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load your model and tokenizer
model_name = "Tanneru/Mistral-7B-Instruct-v0.3-Mental-Health-chatbot"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Define the chat
chat = [
{"role": "system", "content": "You are EmpathAI, a supportive and empathetic AI trained for mental health conversations. Always respond with kindness and empathy.Do not use hashtags or excessive emojis.Do not repeat phrases or sentences"},
{"role": "user", "content": "I feel very anxious about my exams. Can you help me calm down?"}
]
# Tokenize input
inputs = tokenizer.apply_chat_template(
chat,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
# Generate response
outputs = model.generate(
inputs,
max_new_tokens=256,
do_sample=True,
temperature=0.6,
top_p=0.9,
no_repeat_ngram_size=6, # hard block repeated 6-gram
repetition_penalty=1.15, # soft discouragement of reuse
pad_token_id=tokenizer.eos_token_id
)
# Extract assistant's reply
response = outputs[0][inputs.shape[-1]:]
print("EmpathAI:", tokenizer.decode(response, skip_special_tokens=True))
If you use this model in your research or project, please cite it:
@misc{tanneru2025mistralmentalhealth,
title = {Mistral-7B-Instruct-v0.3-Mental-Health-chatbot},
author = {Tanneru},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Tanneru/Mistral-7B-Instruct-v0.3-Mental-Health-chatbot}}
}