Views
No views yet
unsloth/Qwen2-7B-Instruct-bnb-4bit model, designed to simulate conversations between a psychotherapist and a patient. This model was developed as a research tool to explore and understand the dynamics of therapeutic dialogue in a controlled, ethical environment.This is a Research Simulation, Not a Therapist
This model is an experimental tool created for educational and research purposes only. It is NOT a substitute for professional medical or psychological advice, diagnosis, or treatment.The AI can make mistakes, generate incorrect or inappropriate information, and does not possess the qualifications to provide real therapeutic guidance.If you are seeking help for your mental health, please contact a qualified healthcare provider or a crisis hotline.
unsloth/Qwen2-7B-Instruct-bnb-4bittransformers library in Python.1from unsloth import FastLanguageModel
2from transformers import TextStreamer
3
4# Load the fine-tuned model
5model, tokenizer = FastLanguageModel.from_pretrained(
6 model_name = "your-hf-username/Mental-D0C-lora", # Replace with your model name
7 max_seq_length = 2048,
8 load_in_4bit = True,
9 device_map = "auto",
10)
11
12# Prepare the conversation
13messages = [
14 {"role": "user", "content": "I've been feeling really down lately and I don't know why."},
15]
16
17input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
18
19# Generate a response
20text_streamer = TextStreamer(tokenizer, skip_prompt=True)
21_ = model.generate(
22 input_ids=input_ids,
23 streamer=text_streamer,
24 max_new_tokens=150,
25 do_sample=True,
26 temperature=0.7,
27 top_p=0.9,
28 eos_token_id=tokenizer.eos_token_id
29)