Instructions to use piyushgaba07/MAYA_Llama_2_7b_quantized_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use piyushgaba07/MAYA_Llama_2_7b_quantized_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="piyushgaba07/MAYA_Llama_2_7b_quantized_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("piyushgaba07/MAYA_Llama_2_7b_quantized_model") model = AutoModelForCausalLM.from_pretrained("piyushgaba07/MAYA_Llama_2_7b_quantized_model") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use piyushgaba07/MAYA_Llama_2_7b_quantized_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "piyushgaba07/MAYA_Llama_2_7b_quantized_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "piyushgaba07/MAYA_Llama_2_7b_quantized_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/piyushgaba07/MAYA_Llama_2_7b_quantized_model
- SGLang
How to use piyushgaba07/MAYA_Llama_2_7b_quantized_model 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 "piyushgaba07/MAYA_Llama_2_7b_quantized_model" \ --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": "piyushgaba07/MAYA_Llama_2_7b_quantized_model", "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 "piyushgaba07/MAYA_Llama_2_7b_quantized_model" \ --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": "piyushgaba07/MAYA_Llama_2_7b_quantized_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use piyushgaba07/MAYA_Llama_2_7b_quantized_model with Docker Model Runner:
docker model run hf.co/piyushgaba07/MAYA_Llama_2_7b_quantized_model
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π§ LLaMA 2 7B - Mental Therapy (Quantized, Instruction-Tuned)
Welcome to the repository for the LLaMA 2 7B Mental Therapy Quantized model β a safe and supportive conversational AI fine-tuned on mental health and therapy-related dialogues. Built on Metaβs LLaMA 2 7B, this model has been trained to generate empathetic, context-aware, and non-judgmental responses for users seeking emotional support and motivation.
β οΈ 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.
π‘ Model Highlights
- π§ Base model:
meta-llama/Llama-2-7b-hf - π§ Fine-tuning objective: Mental health and supportive conversation
- π§± Quantization: 4-bit (QLoRA) using
bitsandbytes - π§Ύ Instruction format: Chat-like structure with
### Userand### Assistantprompts - π Safe & empathetic responses: Fine-tuned with filtered mental health-related corpora
- π« Very low toxicity: Evaluated with Detoxify and manual audits
π§ͺ Intended Use
This model is ideal for:
- Emotional wellness chatbots
- AI journaling assistants
- Motivational and CBT-style coaching tools
- Empathetic conversational agents for non-critical use
It is not suitable for:
- Diagnosing or treating mental illnesses
- Emergency or crisis intervention
- Replacing human therapists or counselors
π How to Use
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "your-username/llama-2-7b-mental-therapy-quantized"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.float16
)
prompt = """### User: I'm feeling overwhelmed and anxious all the time. What should I do?
### Assistant:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=200)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
- Downloads last month
- 8