PEFT
Safetensors

You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Model Card for Model ID

This is a fine-tuned version of the Mistral-7B-Instruct-v0.2 using theMental Health Counseling Conversations dataset.

Uses

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig

base_model = "mistralai/Mistral-7B-Instruct-v0.2"
adapter_model = "efsanokur/therapist"
 
model = AutoModelForCausalLM.from_pretrained(base_model)
model = PeftModel.from_pretrained(model, adapter_model)
tokenizer = AutoTokenizer.from_pretrained(base_model)

model = model.to("cuda")
model.eval()

import torch
def build_prompt(question):
  prompt=f"<s>[INST]@Therapist. {question} [/INST]"
  return prompt

question = "Why do I never want to leave my bed?"
prompt = build_prompt(question)
inputs = tokenizer(prompt, return_tensors="pt")

with torch.no_grad():
    outputs = model.generate(input_ids=inputs["input_ids"].to("cuda"), max_new_tokens=30)
    print(tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0])
[INST]@Therapist. Why don't I ever want to leave my bed? 
[/INST]I'm glad you wrote.  I'm not a doctor, but I can 
tell you that I've worked with many people who have felt 
the same way.  It's a common symptom of depression.  It's 
also common for people who are dealing with anxiety and stress.  
It's a vicious cycle.  The more you stay in bed, the more 
you feel like staying in bed.  The more you feel like staying 
in bed, the more you have to deal with whatever is causing you 
to feel so badly in the first place.  It's a good idea to talk 
to a therapist about this.  A good therapist will help you to 
figure out what's going on and what you can do about it.  I wish you well.
  • PEFT 0.11.0
Downloads last month
0
Inference API
Unable to determine this model’s pipeline type. Check the docs .

Model tree for efsanokur/therapist

Adapter
(886)
this model

Dataset used to train efsanokur/therapist