ShenLab/MentalChat16K
Viewer • Updated • 16.1k • 1.96k • 60
How to use advy/llama71b-mentalchat16k with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-70B-Instruct")
model = PeftModel.from_pretrained(base_model, "advy/llama71b-mentalchat16k")How to use advy/llama71b-mentalchat16k with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="advy/llama71b-mentalchat16k")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("advy/llama71b-mentalchat16k", dtype="auto")How to use advy/llama71b-mentalchat16k with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "advy/llama71b-mentalchat16k"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "advy/llama71b-mentalchat16k",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/advy/llama71b-mentalchat16k
How to use advy/llama71b-mentalchat16k with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "advy/llama71b-mentalchat16k" \
--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": "advy/llama71b-mentalchat16k",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "advy/llama71b-mentalchat16k" \
--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": "advy/llama71b-mentalchat16k",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use advy/llama71b-mentalchat16k with Docker Model Runner:
docker model run hf.co/advy/llama71b-mentalchat16k
This model is a fine-tuned version of meta-llama/Llama-3.1-70B-Instruct on the ShenLab/MentalChat16k dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.8207 | 0.1496 | 100 | 0.7920 |
| 0.7716 | 0.2992 | 200 | 0.7492 |
| 0.7208 | 0.4488 | 300 | 0.7363 |
| 0.7237 | 0.5985 | 400 | 0.7187 |
| 0.7156 | 0.7481 | 500 | 0.7088 |
| 0.7024 | 0.8977 | 600 | 0.6963 |
| 0.6125 | 1.0464 | 700 | 0.7004 |
| 0.5753 | 1.1960 | 800 | 0.6942 |
| 0.5497 | 1.3456 | 900 | 0.6878 |
| 0.5589 | 1.4952 | 1000 | 0.6804 |
| 0.5453 | 1.6448 | 1100 | 0.6761 |
| 0.5316 | 1.7945 | 1200 | 0.6693 |
| 0.5422 | 1.9441 | 1300 | 0.6634 |
| 0.349 | 2.0928 | 1400 | 0.7011 |
| 0.3481 | 2.2424 | 1500 | 0.7033 |
| 0.337 | 2.3920 | 1600 | 0.7048 |
| 0.3505 | 2.5416 | 1700 | 0.7049 |
| 0.3424 | 2.6912 | 1800 | 0.7052 |
LLAMA 3.1 TEST SET EVALUATION:
================================================== ROUGE Scores (Average F-Measure):
Base model
meta-llama/Llama-3.1-70B