Views
No views yet
⚠️ This model is not a replacement for professional mental health care. Use responsibly and always consult a licensed expert in case of serious mental health concerns.
meta-llama/Llama-2-7b-hfbitsandbytes### User and ### Assistant prompts1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "your-username/llama-2-7b-mental-therapy-quantized"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 device_map="auto",
10 torch_dtype=torch.float16
11)
12
13prompt = """### User: I'm feeling overwhelmed and anxious all the time. What should I do?
14### Assistant:"""
15
16inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
17outputs = model.generate(**inputs, max_new_tokens=200)
18response = tokenizer.decode(outputs[0], skip_special_tokens=True)
19
20print(response)