HuggingFaceH4/ultrafeedback_binarized
Viewer • Updated • 187k • 15.9k • 335
How to use tanliboy/lambda-llama-3-8b-dpo-test-orca with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tanliboy/lambda-llama-3-8b-dpo-test-orca")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tanliboy/lambda-llama-3-8b-dpo-test-orca")
model = AutoModelForCausalLM.from_pretrained("tanliboy/lambda-llama-3-8b-dpo-test-orca")
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 tanliboy/lambda-llama-3-8b-dpo-test-orca with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tanliboy/lambda-llama-3-8b-dpo-test-orca"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tanliboy/lambda-llama-3-8b-dpo-test-orca",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tanliboy/lambda-llama-3-8b-dpo-test-orca
How to use tanliboy/lambda-llama-3-8b-dpo-test-orca with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tanliboy/lambda-llama-3-8b-dpo-test-orca" \
--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": "tanliboy/lambda-llama-3-8b-dpo-test-orca",
"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 "tanliboy/lambda-llama-3-8b-dpo-test-orca" \
--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": "tanliboy/lambda-llama-3-8b-dpo-test-orca",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tanliboy/lambda-llama-3-8b-dpo-test-orca with Docker Model Runner:
docker model run hf.co/tanliboy/lambda-llama-3-8b-dpo-test-orca
This model is a fine-tuned version of meta-llama/Meta-Llama-3.1-8B-Instruct on the HuggingFaceH4/ultrafeedback_binarized and the tanliboy/orca_dpo_pairs datasets. 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.6011 | 0.1744 | 100 | 0.5738 | -0.8770 | -1.2808 | 0.6988 | 0.4038 | -492.2603 | -468.4565 | -2.4544 | -2.4042 |
| 0.5447 | 0.3489 | 200 | 0.5242 | -1.3236 | -2.0879 | 0.7289 | 0.7644 | -572.9752 | -513.1177 | -2.6319 | -2.5732 |
| 0.5173 | 0.5233 | 300 | 0.5003 | -1.6828 | -2.6810 | 0.7259 | 0.9982 | -632.2809 | -549.0404 | -2.6140 | -2.5556 |
| 0.5144 | 0.6978 | 400 | 0.4851 | -1.7107 | -2.8135 | 0.7319 | 1.1028 | -645.5279 | -551.8306 | -2.7027 | -2.6365 |
| 0.5162 | 0.8722 | 500 | 0.4798 | -1.7085 | -2.8440 | 0.7259 | 1.1355 | -648.5815 | -551.6072 | -2.6442 | -2.5812 |
Base model
meta-llama/Llama-3.1-8B