Anthropic/hh-rlhf
Viewer • Updated • 169k • 32k • 2.34k
How to use W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539")
model = AutoModelForCausalLM.from_pretrained("W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539", 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/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539"
# 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/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539
How to use W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539" \
--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/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539",
"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/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539" \
--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/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539 with Docker Model Runner:
docker model run hf.co/W-61/llama-3-8b-base-beta-dpo-hh-harmless-4xh200-batch-64-20260417-233539
This model is a fine-tuned version of llama-3-8b-base-sft-hh-harmless-4xh200-batch-64 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.3014 | 0.1512 | 100 | 0.6391 | 0.1183 | 1.3224 | 0.1789 | 0.4749 | -0.4595 | 0.1057 | 1.0180 | 3.3360 | 0.1183 | 0.1183 | 1.0 | 0.2572 | 0.2207 |
| 0.9318 | 0.3023 | 200 | 0.5939 | 0.0752 | 9.0802 | 0.8670 | 1.1566 | -0.3975 | 0.1333 | 10.1709 | 15.2637 | 0.0346 | 0.0752 | 1.0 | 0.4250 | 0.3786 |
| 1.1289 | 0.4535 | 300 | 0.6938 | 0.1151 | 14.7143 | 2.1435 | 2.8181 | -0.3684 | 0.1767 | 15.7264 | 23.2621 | 0.0393 | 0.1151 | 1.0 | 0.5036 | 0.4522 |
| 1.3777 | 0.6047 | 400 | 0.6486 | 0.0698 | 13.2713 | 1.2326 | 1.6702 | -0.4066 | 0.1228 | 15.5137 | 23.8374 | -0.0345 | 0.0698 | 1.0 | 0.4392 | 0.3876 |
| 1.1911 | 0.7559 | 500 | 0.6888 | 0.0936 | 16.0572 | 1.9620 | 2.5727 | -0.3866 | 0.1471 | 17.9087 | 28.7161 | -0.0111 | 0.0936 | 1.0 | 0.5027 | 0.4490 |
| 1.0347 | 0.9070 | 600 | 0.8203 | 0.1705 | 16.6192 | 3.5151 | 4.7567 | -0.3392 | 0.2229 | 16.4768 | 28.4131 | 0.1085 | 0.1705 | 1.0 | 0.5021 | 0.4487 |