HuggingFaceH4/ultrafeedback_binarized
Viewer • Updated • 187k • 17.9k • 344
How to use ondevicellm/zephyr-7b-dpo-full with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ondevicellm/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("ondevicellm/zephyr-7b-dpo-full")
model = AutoModelForCausalLM.from_pretrained("ondevicellm/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]:]))How to use ondevicellm/zephyr-7b-dpo-full with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ondevicellm/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": "ondevicellm/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ondevicellm/zephyr-7b-dpo-full
How to use ondevicellm/zephyr-7b-dpo-full with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ondevicellm/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": "ondevicellm/zephyr-7b-dpo-full",
"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 "ondevicellm/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": "ondevicellm/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ondevicellm/zephyr-7b-dpo-full with Docker Model Runner:
docker model run hf.co/ondevicellm/zephyr-7b-dpo-full
This model is a fine-tuned version of alignment-handbook/zephyr-7b-sft-full on the HuggingFaceH4/ultrafeedback_binarized 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 | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.6338 | 0.1 | 100 | 0.6333 | -0.4184 | -0.6017 | 0.6865 | 0.1833 | -321.9407 | -325.9421 | -2.4857 | -2.5392 |
| 0.5643 | 0.21 | 200 | 0.5547 | -1.1977 | -1.8547 | 0.7480 | 0.6570 | -447.2422 | -403.8748 | 0.1190 | -0.4672 |
| 0.5066 | 0.31 | 300 | 0.5214 | -0.9561 | -1.7858 | 0.7778 | 0.8297 | -440.3582 | -379.7161 | -0.7390 | -1.4155 |
| 0.4941 | 0.42 | 400 | 0.5082 | -1.2581 | -2.1325 | 0.7599 | 0.8744 | -475.0238 | -409.9142 | 0.1688 | -0.7662 |
| 0.506 | 0.52 | 500 | 0.5090 | -1.1067 | -2.0712 | 0.7639 | 0.9645 | -468.8966 | -394.7739 | 1.3983 | 0.0857 |
| 0.4893 | 0.63 | 600 | 0.4953 | -1.4696 | -2.4963 | 0.7579 | 1.0267 | -511.4048 | -431.0652 | 0.9613 | -0.4181 |
| 0.4558 | 0.73 | 700 | 0.4937 | -1.8124 | -2.8894 | 0.7698 | 1.0770 | -550.7128 | -465.3409 | 0.6946 | -0.4445 |
| 0.4781 | 0.84 | 800 | 0.4898 | -1.9968 | -3.0983 | 0.7698 | 1.1015 | -571.6086 | -483.7863 | 0.7311 | -0.4503 |
| 0.495 | 0.94 | 900 | 0.4894 | -1.9365 | -3.0176 | 0.7698 | 1.0812 | -563.5378 | -477.7505 | 0.6757 | -0.4642 |
Base model
mistralai/Mistral-7B-v0.1