Anthropic/hh-rlhf
Viewer • Updated • 169k • 32k • 2.34k
How to use W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64")
model = AutoModelForCausalLM.from_pretrained("W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64", 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 W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64
How to use W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64" \
--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": "W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64",
"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 "W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64" \
--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": "W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64 with Docker Model Runner:
docker model run hf.co/W-61/mistral-7b-base-beta-dpo-hh-helpful-4xh200-batch-64
This model is a fine-tuned version of mistral-7b-base-sft-hh-helpful-4xh200-batch-64-20260418-015332 on the Anthropic/hh-rlhf 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 | Beta Dpo/beta | Beta Dpo/loss Margin Mean | Beta Dpo/beta Margin Mean | Beta Dpo/beta Margin Std | Beta Dpo/beta Margin Grad Mean | Beta Dpo/beta Margin Grad Std | Beta Dpo/gap Mean | Beta Dpo/gap Std | Beta Dpo/beta Used Raw | Beta Dpo/beta Used | Beta Dpo/mask Keep Frac | Logits/chosen | Logits/rejected |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1.3346 | 0.1468 | 100 | 0.7825 | 0.0211 | 38.6966 | 1.4685 | 2.0475 | -0.4727 | 0.0403 | 60.6513 | 63.8526 | -1.2173 | 0.0211 | 1.0 | -2.9129 | -2.9033 |
| 1.265 | 0.2937 | 200 | 1.2116 | 0.0416 | 108.9061 | 8.0746 | 10.4591 | -0.4594 | 0.0608 | 175.9197 | 183.7102 | -3.9208 | 0.0416 | 1.0 | -2.3116 | -2.3059 |
| 0.5857 | 0.4405 | 300 | 0.6708 | 0.0032 | 165.3890 | 0.8039 | 1.0106 | -0.4553 | 0.0715 | 284.4015 | 265.4041 | -7.0408 | 0.0032 | 1.0 | -2.3951 | -2.3756 |
| 3.7878 | 0.5874 | 400 | 0.6122 | 0.0010 | 205.4126 | 0.2054 | 0.3571 | -0.4506 | 0.0845 | 362.1024 | 333.2912 | -9.3014 | 0.0010 | 1.0 | -2.4431 | -2.4332 |
| 6.7444 | 0.7342 | 500 | 0.6026 | 0.0010 | 233.9227 | 0.2339 | 0.3910 | -0.4441 | 0.0919 | 390.5113 | 345.8571 | -9.2953 | 0.0010 | 1.0 | -2.6421 | -2.6564 |
| 0.5388 | 0.8811 | 600 | 0.6015 | 0.0010 | 243.4043 | 0.2434 | 0.4217 | -0.4422 | 0.0983 | 404.4037 | 357.4069 | -9.5600 | 0.0010 | 1.0 | -2.7813 | -2.8108 |