HuggingFaceH4/ultrafeedback_binarized
Viewer • Updated • 187k • 17k • 338
How to use fenguhao/zephyr-7b-dpo-full with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="fenguhao/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("fenguhao/zephyr-7b-dpo-full")
model = AutoModelForCausalLM.from_pretrained("fenguhao/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 fenguhao/zephyr-7b-dpo-full with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "fenguhao/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": "fenguhao/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/fenguhao/zephyr-7b-dpo-full
How to use fenguhao/zephyr-7b-dpo-full with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "fenguhao/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": "fenguhao/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 "fenguhao/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": "fenguhao/zephyr-7b-dpo-full",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use fenguhao/zephyr-7b-dpo-full with Docker Model Runner:
docker model run hf.co/fenguhao/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.5764 | 0.2 | 100 | 0.5829 | -0.3592 | -0.7613 | 0.6931 | 0.4020 | -340.8605 | -313.6503 | -2.4360 | -2.4791 |
| 0.5169 | 0.39 | 200 | 0.5312 | -0.8847 | -1.6204 | 0.7066 | 0.7356 | -426.7720 | -366.2012 | -0.8443 | -1.2010 |
| 0.5133 | 0.59 | 300 | 0.5159 | -1.1886 | -1.9604 | 0.7246 | 0.7718 | -460.7765 | -396.5906 | 0.0460 | -0.3853 |
| 0.4968 | 0.79 | 400 | 0.5058 | -1.2445 | -2.1063 | 0.7141 | 0.8618 | -475.3639 | -402.1766 | 0.2014 | -0.2552 |
| 0.4833 | 0.98 | 500 | 0.5045 | -1.1821 | -2.0581 | 0.7260 | 0.8760 | -470.5448 | -395.9374 | 0.0436 | -0.4496 |
Base model
mistralai/Mistral-7B-v0.1