HuggingFaceH4/ultrafeedback_binarized
Viewer • Updated • 187k • 15.9k • 335
How to use ishant0121/zephyr-7b-dpo-full with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ishant0121/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("ishant0121/zephyr-7b-dpo-full")
model = AutoModelForCausalLM.from_pretrained("ishant0121/zephyr-7b-dpo-full")
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 ishant0121/zephyr-7b-dpo-full with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ishant0121/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": "ishant0121/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ishant0121/zephyr-7b-dpo-full
How to use ishant0121/zephyr-7b-dpo-full with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ishant0121/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": "ishant0121/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 "ishant0121/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": "ishant0121/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ishant0121/zephyr-7b-dpo-full with Docker Model Runner:
docker model run hf.co/ishant0121/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 | Logits/chosen | Logits/rejected | Logps/chosen | Logps/rejected | Validation Loss | Rewards/accuracies | Rewards/chosen | Rewards/margins | Rewards/rejected |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.6267 | 0.1047 | 100 | -2.4885 | -2.4228 | -298.8784 | -298.6605 | 0.6219 | 0.7123 | -0.1691 | 0.2154 | -0.3845 |
| 0.5618 | 0.2093 | 200 | -1.1643 | -0.9025 | -368.7673 | -409.5043 | 0.5559 | 0.75 | -0.8680 | 0.6250 | -1.4930 |
| 0.5298 | 0.3140 | 300 | 0.1099 | 0.5848 | -387.0007 | -442.8027 | 0.5283 | 0.7679 | -1.0503 | 0.7756 | -1.8260 |
| 0.5585 | 0.4186 | 400 | -1.2260 | -0.6461 | -368.9012 | -419.9413 | 0.5200 | 0.7639 | -0.8693 | 0.7280 | -1.5973 |
| 0.5074 | 0.5233 | 500 | 0.1651 | 0.9655 | -402.5899 | -472.5687 | 0.5043 | 0.7698 | -1.2062 | 0.9174 | -2.1236 |
| 0.4678 | 0.6279 | 600 | -0.1276 | 0.7528 | -405.3750 | -480.0774 | 0.4995 | 0.7698 | -1.2341 | 0.9646 | -2.1987 |
| 0.4767 | 0.7326 | 700 | 0.4974 | -1.3438 | -2.3581 | 0.7619 | 1.0142 | -496.0146 | -416.3518 | 1.1957 | 0.3567 |
| 0.475 | 0.8373 | 800 | 0.4971 | -1.3985 | -2.3889 | 0.7639 | 0.9904 | -499.1005 | -421.8184 | 1.0101 | 0.2102 |
| 0.4828 | 0.9419 | 900 | 0.4963 | -1.3653 | -2.3944 | 0.7639 | 1.0292 | -499.6516 | -418.4965 | 1.1202 | 0.2514 |
Base model
mistralai/Mistral-7B-v0.1