u-10bei/dpo-dataset-qwen-cot
Viewer • Updated • 4.04k • 117 • 2
How to use tomofusa/exp040-soup-3model-weighted with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tomofusa/exp040-soup-3model-weighted")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tomofusa/exp040-soup-3model-weighted")
model = AutoModelForCausalLM.from_pretrained("tomofusa/exp040-soup-3model-weighted")
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 tomofusa/exp040-soup-3model-weighted with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tomofusa/exp040-soup-3model-weighted"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tomofusa/exp040-soup-3model-weighted",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tomofusa/exp040-soup-3model-weighted
How to use tomofusa/exp040-soup-3model-weighted with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tomofusa/exp040-soup-3model-weighted" \
--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": "tomofusa/exp040-soup-3model-weighted",
"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 "tomofusa/exp040-soup-3model-weighted" \
--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": "tomofusa/exp040-soup-3model-weighted",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tomofusa/exp040-soup-3model-weighted with Docker Model Runner:
docker model run hf.co/tomofusa/exp040-soup-3model-weighted
Weighted Model Soup of 3 fine-tuned models for structured output generation (JSON / YAML / TOML / XML / CSV).
Full 16-bit merged weights. No adapter loading required.
This model is created by weighted averaging of 3 independently trained models:
| Weight | Model | Training | Score |
|---|---|---|---|
| 0.50 | tomofusa/exp017-dpo-ipo-merged | SFT + DPO (IPO, lr=5e-7) | 0.789 |
| 0.25 | tomofusa/exp020-simpo-merged | SFT + CPO/SimPO (beta=2.5) | 0.789 |
| 0.25 | tomofusa/exp034-toml-upsample-dpo-merged | SFT (TOML upsampled) + DPO (IPO) | 0.765 |
Soup method: model_A * 0.5 + model_B * 0.25 + model_C * 0.25 applied to all weight tensors.
All source models share the same base pipeline:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "tomofusa/exp040-soup-3model-weighted"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
)
Base model
Qwen/Qwen3-4B-Instruct-2507