tanliboy/orca_dpo_pairs
Viewer • Updated • 12.9k • 17
How to use tanliboy/lambda-qwen2.5-32b-dpo-test with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tanliboy/lambda-qwen2.5-32b-dpo-test")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tanliboy/lambda-qwen2.5-32b-dpo-test")
model = AutoModelForCausalLM.from_pretrained("tanliboy/lambda-qwen2.5-32b-dpo-test")
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-qwen2.5-32b-dpo-test with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tanliboy/lambda-qwen2.5-32b-dpo-test"
# 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-qwen2.5-32b-dpo-test",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tanliboy/lambda-qwen2.5-32b-dpo-test
How to use tanliboy/lambda-qwen2.5-32b-dpo-test with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tanliboy/lambda-qwen2.5-32b-dpo-test" \
--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-qwen2.5-32b-dpo-test",
"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-qwen2.5-32b-dpo-test" \
--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-qwen2.5-32b-dpo-test",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tanliboy/lambda-qwen2.5-32b-dpo-test with Docker Model Runner:
docker model run hf.co/tanliboy/lambda-qwen2.5-32b-dpo-test
This model is a fine-tuned version of Qwen/Qwen2.5-32B-Instruct on the tanliboy/orca_dpo_pairs 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.0103 | 0.2618 | 100 | 0.0060 | -8.5159 | -18.7731 | 1.0 | 10.2572 | -2315.3333 | -1208.2968 | -0.5485 | -0.2481 |
| 0.0005 | 0.5236 | 200 | 0.0005 | -9.9255 | -24.9117 | 1.0 | 14.9862 | -2929.1948 | -1349.2588 | -0.3723 | -0.0661 |
| 0.0005 | 0.7853 | 300 | 0.0004 | -10.0873 | -25.9319 | 1.0 | 15.8446 | -3031.2175 | -1365.4342 | -0.2882 | -0.0014 |
Base model
Qwen/Qwen2.5-32B