TinyLlama MentalChat LoRA

This repository contains a LoRA adapter fine-tuned on the
ShenLab/MentalChat16K dataset
for mental health–related supportive dialogue.

⚠️ This is not a full model.
It is a lightweight LoRA adapter that must be used together with the base model.


πŸ” Model Overview

  • Base Model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
  • Fine-tuning Method: LoRA (PEFT)
  • Domain: Mental health supportive conversations
  • Language: English
  • Adapter Size: ~50 MB

πŸ“š Training Data

The model was fine-tuned using the MentalChat16K dataset, which consists of mental health–related conversations between users and assistants.

  • Dataset: ShenLab/MentalChat16K
  • Language: English
  • Task: Supportive, empathetic responses in mental health contexts

πŸš€ Usage

Load Base Model + LoRA Adapter

from unsloth import FastLanguageModel
from peft import PeftModel
import torch

# Load base model
base_model, tokenizer = FastLanguageModel.from_pretrained(
    "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
    max_seq_length=2048,
    load_in_4bit=True,
)

# Load LoRA adapter
lora_model = PeftModel.from_pretrained(
    base_model,
    "BEncoderRT/tinyllama-mentalchat-lora",
)

FastLanguageModel.for_inference(lora_model)
FastLanguageModel.for_inference(base_model)

def generate(model, prompt, max_new_tokens=200):
    inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

    with torch.no_grad():
        outputs = model.generate(
            **inputs,
            max_new_tokens=max_new_tokens,
            do_sample=True,
            temperature=0.7,
            top_p=0.9,
        )

    return tokenizer.decode(outputs[0], skip_special_tokens=True)

---

prompt = """### Instruction:
I feel empty and hopeless lately. Nothing seems meaningful.

### Response:
"""

print("=== Base Model ===")
print(generate(base_model, prompt))

print("\n=== LoRA Model ===")
print(generate(lora_model, prompt))




=== Base Model ===
### Instruction:
I feel empty and hopeless lately. Nothing seems meaningful.

### Response:
It's okay to feel like this. We all have moments where life seems empty and meaningless. It's important to remember that it's normal to feel this way sometimes. Remember that you are not alone in this, and that you can find ways to cope and find meaning in your life.

As we continue to talk, I'd like to explore some specific ways you can find meaning in your life. One possibility is by pursuing your passions. Do you have any hobbies or interests that bring you joy? Maybe exploring a new hobby or starting a hobby you've been wanting to try. This could be a great way to find a sense of purpose and fulfillment in your life.

Another idea could be to focus on the present moment. Take a few deep breaths and try to notice the sensations in your body. Notice the feelings of happiness or sadness that arise when you're surrounded



=== LoRA Model ===
### Instruction:
I feel empty and hopeless lately. Nothing seems meaningful.

### Response:
It's understandable that you're feeling down at the moment, but let's take a moment to acknowledge the emotions we're experiencing. Sometimes, it can be helpful to talk about our thoughts and feelings in a safe and non-judgmental space.

Remember that it's not just you who's going through this, but also the people around you. It's important to share your feelings with them, even if they're not the same as you. They may be able to provide you with some support and understanding.

Remember that this is a journey, and it's okay to take time to reflect on what's important to you. It's also important to remember that there are many ways to cope with stress and anxiety, including self-care, exercise, and spending time in nature.

I hope these suggestions help you feel more supported and less alone. Remember that you'
Downloads last month
40
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for BEncoderRT/tinyllama-mentalchat-lora

Adapter
(1286)
this model

Dataset used to train BEncoderRT/tinyllama-mentalchat-lora