Text Generation
Transformers
TensorBoard
Safetensors
mistral
Generated from Trainer
conversational
text-generation-inference
Instructions to use tianlinliu0121/zephyr-7b-dpo-full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tianlinliu0121/zephyr-7b-dpo-full with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tianlinliu0121/zephyr-7b-dpo-full") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tianlinliu0121/zephyr-7b-dpo-full") model = AutoModelForCausalLM.from_pretrained("tianlinliu0121/zephyr-7b-dpo-full", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tianlinliu0121/zephyr-7b-dpo-full with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tianlinliu0121/zephyr-7b-dpo-full" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tianlinliu0121/zephyr-7b-dpo-full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tianlinliu0121/zephyr-7b-dpo-full
- SGLang
How to use tianlinliu0121/zephyr-7b-dpo-full 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 "tianlinliu0121/zephyr-7b-dpo-full" \ --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": "tianlinliu0121/zephyr-7b-dpo-full", "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 "tianlinliu0121/zephyr-7b-dpo-full" \ --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": "tianlinliu0121/zephyr-7b-dpo-full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tianlinliu0121/zephyr-7b-dpo-full with Docker Model Runner:
docker model run hf.co/tianlinliu0121/zephyr-7b-dpo-full
How to use from
SGLangUse 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 "tianlinliu0121/zephyr-7b-dpo-full" \
--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": "tianlinliu0121/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'Quick Links
zephyr-7b-dpo-full
This model is a fine-tuned version of alignment-handbook/zephyr-7b-sft-full on the None dataset. It achieves the following results on the evaluation set:
- Loss: 0.6641
- Rewards/chosen: -4.2025
- Rewards/rejected: -7.5064
- Rewards/accuracies: 0.7740
- Rewards/margins: 3.3038
- Logps/rejected: -318.9220
- Logps/chosen: -321.7840
- Logits/rejected: -2.6752
- Logits/chosen: -2.7102
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-07
- train_batch_size: 8
- eval_batch_size: 4
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 4
- total_train_batch_size: 128
- total_eval_batch_size: 16
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 3
Training results
| Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.5058 | 0.21 | 100 | 0.4911 | -0.1160 | -1.1492 | 0.7620 | 1.0332 | -242.3301 | -272.5491 | -3.0425 | -3.0547 |
| 0.4946 | 0.41 | 200 | 0.4825 | -0.3097 | -1.5239 | 0.7660 | 1.2143 | -246.8446 | -274.8822 | -2.9173 | -2.9312 |
| 0.4777 | 0.62 | 300 | 0.4710 | -0.1682 | -1.3949 | 0.7800 | 1.2266 | -245.2894 | -273.1778 | -2.9493 | -2.9706 |
| 0.4795 | 0.83 | 400 | 0.4613 | -0.3814 | -1.7739 | 0.7880 | 1.3925 | -249.8568 | -275.7468 | -2.8663 | -2.8864 |
| 0.1195 | 1.03 | 500 | 0.4680 | -0.6715 | -2.3344 | 0.7880 | 1.6629 | -256.6091 | -279.2414 | -2.7880 | -2.8173 |
| 0.1038 | 1.24 | 600 | 0.4890 | -1.2315 | -3.1990 | 0.7740 | 1.9675 | -267.0262 | -285.9885 | -2.7944 | -2.8235 |
| 0.1091 | 1.45 | 700 | 0.4969 | -1.5189 | -3.4689 | 0.7720 | 1.9499 | -270.2775 | -289.4514 | -2.7692 | -2.7947 |
| 0.1017 | 1.65 | 800 | 0.4938 | -1.5010 | -3.5680 | 0.7780 | 2.0670 | -271.4719 | -289.2352 | -2.7970 | -2.8233 |
| 0.0853 | 1.86 | 900 | 0.5150 | -1.9917 | -4.1892 | 0.7840 | 2.1975 | -278.9565 | -295.1473 | -2.7667 | -2.7959 |
| 0.0214 | 2.07 | 1000 | 0.5713 | -2.9307 | -5.6016 | 0.7740 | 2.6709 | -295.9729 | -306.4606 | -2.7489 | -2.7811 |
| 0.0169 | 2.27 | 1100 | 0.6226 | -3.6197 | -6.6310 | 0.7760 | 3.0112 | -308.3753 | -314.7625 | -2.7096 | -2.7449 |
| 0.0192 | 2.48 | 1200 | 0.6315 | -3.8462 | -6.9302 | 0.7760 | 3.0839 | -311.9800 | -317.4913 | -2.6779 | -2.7147 |
| 0.0157 | 2.68 | 1300 | 0.6585 | -4.1276 | -7.3886 | 0.7760 | 3.2610 | -317.5031 | -320.8812 | -2.6830 | -2.7171 |
| 0.018 | 2.89 | 1400 | 0.6696 | -4.2900 | -7.6252 | 0.7740 | 3.3352 | -320.3536 | -322.8378 | -2.6703 | -2.7057 |
Framework versions
- Transformers 4.35.0
- Pytorch 2.1.0+cu118
- Datasets 2.14.6
- Tokenizers 0.14.1
- Downloads last month
- 7
Model tree for tianlinliu0121/zephyr-7b-dpo-full
Base model
mistralai/Mistral-7B-v0.1 Finetuned
alignment-handbook/zephyr-7b-sft-full
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tianlinliu0121/zephyr-7b-dpo-full" \ --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": "tianlinliu0121/zephyr-7b-dpo-full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'