CoolFace
Modelpublic

Ibrahim-AI-dev/mental-health-counseling-chatbot

sourceHugging Faceapache-2.0updated 11mo agoView on Hugging Face
0likes13downloads
Model Card

Qwen 2.5 7B Instruct - Counseling Fine-tuned (LoRA)

This model is a fine-tuned version of Qwen/Qwen2.5-7B-Instruct using LoRA on a counseling conversations dataset.

๐ŸŽฏ Model Description

This model has been fine-tuned to provide empathetic and professional counseling responses. It's designed to assist with emotional support and guidance in conversations.

โš ๏ธ Important Disclaimer: This model is for educational and research purposes only. It should NOT replace professional mental health services, therapy, or crisis intervention.

๐Ÿ“Š Training Details

  • โ€”Base Model: Qwen/Qwen2.5-7B-Instruct
  • โ€”Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • โ€”Training Framework: Unsloth
  • โ€”Hardware: Single 16GB VRAM GPU
  • โ€”Quantization: 4-bit (QLoRA)
  • โ€”Training Date: 2025-10-20
  • โ€”LoRA Rank: 16
  • โ€”LoRA Alpha: 16
  • โ€”Target Modules: qproj, kproj, vproj, oproj, gateproj, upproj, down_proj

๐Ÿš€ Usage

Installation

bash
pip install unsloth transformers

Basic Usage

python
from unsloth import FastLanguageModel

# Load model
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="Ibrahim-AI-dev/mental-health-counseling-chatbot",
    max_seq_length=2048,
    dtype=None,
    load_in_4bit=True,
)

# Enable inference mode
FastLanguageModel.for_inference(model)

# Create messages
messages = [
    {"role": "system", "content": "You are a professional counselor providing empathetic and helpful responses."},
    {"role": "user", "content": "I'm feeling anxious about my future. What should I do?"}
]

# Generate response
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.7,
    do_sample=True,
    top_p=0.9,
)

response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)

Advanced Usage with Custom Parameters

python
# More creative responses
outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.9,  # Higher = more creative
    top_p=0.95,
    top_k=50,
    repetition_penalty=1.1,
)

# More focused responses
outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.3,  # Lower = more focused
    top_p=0.85,
    do_sample=True,
)

๐Ÿ’พ Model Size

  • โ€”LoRA Adapters: ~50-100 MB
  • โ€”Full Base Model: ~14 GB (required separately)
  • โ€”Merged Model: Available at Ibrahim-AI-dev/mental-health-counseling-chatbot-merged (if uploaded)

๐ŸŽ“ Training Configuration

python
- Learning Rate: 2e-4
- Batch Size: 2 (effective: 8 with gradient accumulation)
- Gradient Accumulation Steps: 4
- Optimizer: AdamW 8-bit
- Max Sequence Length: 2048
- Training Precision: Mixed (FP16/BF16)

๐Ÿ“ˆ Intended Use Cases

  • โ€”Research in conversational AI for mental health
  • โ€”Educational demonstrations of fine-tuning techniques
  • โ€”Prototyping counseling chatbot applications
  • โ€”Studying empathetic response generation

โš ๏ธ Limitations

  • โ€”NOT a replacement for professional mental health care
  • โ€”May not handle crisis situations appropriately
  • โ€”Trained on specific conversation patterns and may not generalize to all scenarios
  • โ€”Should be used with human oversight
  • โ€”May occasionally generate inappropriate or incorrect responses
  • โ€”Limited to text-based interaction

๐Ÿ”’ Ethical Considerations

  • โ€”Always inform users they are interacting with an AI
  • โ€”Provide crisis hotline information for emergencies
  • โ€”Monitor outputs for harmful content
  • โ€”Do not use for diagnosis or treatment
  • โ€”Respect user privacy and confidentiality

๐Ÿ“š Citation

If you use this model in your research, please cite:

bibtex
@misc{qwen2.5-counseling-lora,
  author = {Your Name},
  title = {Qwen 2.5 7B Counseling Fine-tuned (LoRA)},
  year = {2025},
  publisher = {HuggingFace},
  url = {https://huggingface.co/Ibrahim-AI-dev/mental-health-counseling-chatbot}
}

๐Ÿ™ Acknowledgments

๐Ÿ“ž Emergency Resources

If you or someone you know is in crisis:

  • โ€”US: National Suicide Prevention Lifeline: 988 or 1-800-273-8255
  • โ€”UK: Samaritans: 116 123
  • โ€”International: Find local resources at befrienders.org

๐Ÿ“„ License

This model inherits the Apache 2.0 license from Qwen2.5-7B-Instruct.

๐Ÿ”— Links