Instructions to use Junrulu/Reproduced-tulu2-dpo-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Junrulu/Reproduced-tulu2-dpo-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Junrulu/Reproduced-tulu2-dpo-13b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Junrulu/Reproduced-tulu2-dpo-13b") model = AutoModelForCausalLM.from_pretrained("Junrulu/Reproduced-tulu2-dpo-13b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Junrulu/Reproduced-tulu2-dpo-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Junrulu/Reproduced-tulu2-dpo-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Junrulu/Reproduced-tulu2-dpo-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Junrulu/Reproduced-tulu2-dpo-13b
- SGLang
How to use Junrulu/Reproduced-tulu2-dpo-13b 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 "Junrulu/Reproduced-tulu2-dpo-13b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Junrulu/Reproduced-tulu2-dpo-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Junrulu/Reproduced-tulu2-dpo-13b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Junrulu/Reproduced-tulu2-dpo-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Junrulu/Reproduced-tulu2-dpo-13b with Docker Model Runner:
docker model run hf.co/Junrulu/Reproduced-tulu2-dpo-13b
Model Card for Reproduced Tulu2 DPO 13B
This repository provides a reproduction version of Tulu2-DPO-13B finetuned upon Tulu2-13B and Ultrafeedback. Therefore, we obey all licenses mentioned in Tulu2's work. Check our codes for more details: https://github.com/LuJunru/LLM_Finetune/tree/DPO, which is built with TRL.
Performance
| Model | Size | Alignment | MT-Bench (score) | AlpacaEval 2.0 (win rate %) |
|---|---|---|---|---|
| Tulu-v2-13b 🐪 | 13B | SFT | 5.79 | 2.61 |
| Tulu-v2-dpo-13b 🐪 | 13B | DPO | 6.06 | 6.96 |
| Reproduced-tulu2-dpo-13b | 13B | DPO | 6.27 | 6.71 |
Input Format
The model is trained to use the following format (note the newlines):
<|user|>
Your message here!
<|assistant|>
For best results, format all inputs in this manner. Make sure to include a newline after <|assistant|>, this can affect generation quality quite a bit. Note: if fine-tuning with this chat template, ensure to evaluate and test with the chat template. Otherwise, fine-tining without the template if you choose to not use template during testing. Any mismatch of the chatting template between training and testing phases can obviously dampen the final performance.
Training hyperparameters
The following hyperparameters were used during DPO training:
- DPO beta: 0.1
- learning_rate: 1e-6 * sqrt(Num of Nodes)
- total_train_batch_size: 128 * Num of Nodes
- optimizer: AdamW with beta1 0.9, beta2 0.999 and epsilon 1e-8
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- Weight Decay: 0.0
- num_epochs: 3.0
- Specifically add above input format over training samples
- Downloads last month
- 1