u-10bei/dpo-dataset-qwen-cot
Viewer • Updated • 4.04k • 117 • 2
How to use kabuizuchi-trading/gdpo-qwen-structured-merged with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="kabuizuchi-trading/gdpo-qwen-structured-merged")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("kabuizuchi-trading/gdpo-qwen-structured-merged")
model = AutoModelForCausalLM.from_pretrained("kabuizuchi-trading/gdpo-qwen-structured-merged")
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 kabuizuchi-trading/gdpo-qwen-structured-merged with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "kabuizuchi-trading/gdpo-qwen-structured-merged"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kabuizuchi-trading/gdpo-qwen-structured-merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/kabuizuchi-trading/gdpo-qwen-structured-merged
How to use kabuizuchi-trading/gdpo-qwen-structured-merged with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "kabuizuchi-trading/gdpo-qwen-structured-merged" \
--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": "kabuizuchi-trading/gdpo-qwen-structured-merged",
"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 "kabuizuchi-trading/gdpo-qwen-structured-merged" \
--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": "kabuizuchi-trading/gdpo-qwen-structured-merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use kabuizuchi-trading/gdpo-qwen-structured-merged with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kabuizuchi-trading/gdpo-qwen-structured-merged to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kabuizuchi-trading/gdpo-qwen-structured-merged to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kabuizuchi-trading/gdpo-qwen-structured-merged to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="kabuizuchi-trading/gdpo-qwen-structured-merged",
max_seq_length=2048,
)How to use kabuizuchi-trading/gdpo-qwen-structured-merged with Docker Model Runner:
docker model run hf.co/kabuizuchi-trading/gdpo-qwen-structured-merged
This model was trained in two phases:
This repository contains the full-merged 16-bit weights.
GDPO (arxiv 2601.05242, NVIDIA Research) decouples reward normalization across individual rewards, preserving their relative differences.
| # | Reward | Weight | Description |
|---|---|---|---|
| 1 | Format Compliance | 1.0 | Approach/Output structure |
| 2 | Structured Output Validity | 3.0 | JSON/XML/YAML/TOML/CSV parsing |
| 3 | Output Length | 0.3 | Appropriate length |
| 4 | No Repetition | 0.5 | Prevents degeneration |
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "kabuizuchi-trading/gdpo-qwen-structured-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.bfloat16, device_map="auto",
)
Base model
Qwen/Qwen3-4B-Instruct-2507