Instructions to use mark-22/dpo-qwen-cot-merged-dataclearn3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mark-22/dpo-qwen-cot-merged-dataclearn3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mark-22/dpo-qwen-cot-merged-dataclearn3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mark-22/dpo-qwen-cot-merged-dataclearn3") model = AutoModelForCausalLM.from_pretrained("mark-22/dpo-qwen-cot-merged-dataclearn3", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mark-22/dpo-qwen-cot-merged-dataclearn3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mark-22/dpo-qwen-cot-merged-dataclearn3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mark-22/dpo-qwen-cot-merged-dataclearn3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mark-22/dpo-qwen-cot-merged-dataclearn3
- SGLang
How to use mark-22/dpo-qwen-cot-merged-dataclearn3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mark-22/dpo-qwen-cot-merged-dataclearn3" \ --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": "mark-22/dpo-qwen-cot-merged-dataclearn3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "mark-22/dpo-qwen-cot-merged-dataclearn3" \ --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": "mark-22/dpo-qwen-cot-merged-dataclearn3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use mark-22/dpo-qwen-cot-merged-dataclearn3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
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 mark-22/dpo-qwen-cot-merged-dataclearn3 to start chatting
Install Unsloth Studio (Windows)
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 mark-22/dpo-qwen-cot-merged-dataclearn3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mark-22/dpo-qwen-cot-merged-dataclearn3 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="mark-22/dpo-qwen-cot-merged-dataclearn3", max_seq_length=2048, ) - Docker Model Runner
How to use mark-22/dpo-qwen-cot-merged-dataclearn3 with Docker Model Runner:
docker model run hf.co/mark-22/dpo-qwen-cot-merged-dataclearn3
qwen3-4b-sft-dpo-no-cot-merged-dataclearn1
This model is a high-performance, full-merged 16-bit version of Qwen3-4B, specifically optimized for strict structured data generation (JSON, YAML, CSV, etc.). It was developed for the Matsuo Lab LLM Competition with a focus on eliminating conversational noise and maximizing format compliance.
🛠Strategic Training Pipeline
This model deviates from standard tuning by applying rigorous data cleaning to both SFT and DPO stages:
1. Supervised Fine-Tuning (SFT)
- Objective: Direct Mapping from User Query to Structured Data.
- Data Cleaning:
- System Prompts Removed: Matches inference environments where system roles are unavailable.
- CoT Physically Removed: Reasoning traces (Chain-of-Thought) were deleted to force the model to output the final answer immediately, reducing token waste and parse errors.
- Dataset:
u-10bei/structured_data_with_cot_dataset_512_v2
2. Direct Preference Optimization (DPO)
- Objective: Refine output quality and format adherence through preference learning.
- Data Cleaning: Both Chosen and Rejected pairs were stripped of CoT and System prompts. This ensures the model learns the preference based strictly on the content and validity of the structured data itself.
- Dataset:
u-10bei/dpo-dataset-qwen-cot-dataclearn2 - Beta: 0.4
🚀 Model Status: Fully Merged
This repository contains the complete 16-bit weights. No adapters are required. Optimized for immediate response without "Here is the JSON..." or other filler text.
📈 Configuration
- Learning rate: 1e-07
- Epochs: 1
- Max length: 2048
- LoRA Config: r=64, alpha=64
💻 Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "mark-22/dpo-qwen-cot-merged-dataclearn3"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16,
device_map="auto"
)
# The model outputs the data immediately after the user prompt.
messages = [
{"role": "user", "content": "Convert to JSON: name: Alice, age: 30"}
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 19
Model tree for mark-22/dpo-qwen-cot-merged-dataclearn3
Base model
Qwen/Qwen3-4B-Instruct-2507