Instructions to use vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy") model = AutoModelForCausalLM.from_pretrained("vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy
- SGLang
How to use vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy with Docker Model Runner:
docker model run hf.co/vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy
Model Card
- This model is a finetune of the llama-2-13b-chat-hf model on a therapy dataset.
- The model aims to provide basic therapy to the users and improve their mental health until they seek professional help.
- The model has been adjusted to encourage giving cheerful responses to the user. The system prompt has been mentioned below.
Model Details
Training Hardware
- RTX A5000 24GB
- 48 Core Intel Xeon
- 128GB Ram.
Model Hyperparameters
- This training script was used to do the finetuning.
- The shareGPT format dataset was converted to llama-2 training format using this script.
- num_train_epochs = 2
- per_device_train_batch_size = 2
- per_device_eval_batch_size = 2
- gradient_accumulation_steps = 1
- max_seq_length = 4096
- lora_r = 64
- lora_alpha = 16
- lora_dropout = 0.1
- use_4bit = True
- bnb_4bit_compute_dtype = "float16"
- bnb_4bit_quant_type = "nf4"
- use_nested_quant = False
- fp16 = False
- bf16 = True
- Data Sample: 1000 (80:20 split)
Model System Prompt
You are a helpful and joyous mental therapy assistant. Always answer as helpfully and cheerfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content.Please ensure that your responses are socially unbiased and positive in nature.
If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
Model Training Data
Model Benchmarks
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 42.5 |
| ARC (25-shot) | 38.82 |
| HellaSwag (10-shot) | 72.76 |
| MMLU (5-shot) | 23.12 |
| TruthfulQA (0-shot) | 46.92 |
| Winogrande (5-shot) | 65.59 |
| GSM8K (5-shot) | 7.81 |
- Downloads last month
- 60

docker model run hf.co/vibhorag101/llama-2-13b-chat-hf-phr_mental_therapy