Instructions to use Honejudo1234/dpo-qwen-cot-merged_exp09 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Honejudo1234/dpo-qwen-cot-merged_exp09 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Honejudo1234/dpo-qwen-cot-merged_exp09") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Honejudo1234/dpo-qwen-cot-merged_exp09") model = AutoModelForCausalLM.from_pretrained("Honejudo1234/dpo-qwen-cot-merged_exp09", 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 Honejudo1234/dpo-qwen-cot-merged_exp09 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Honejudo1234/dpo-qwen-cot-merged_exp09" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Honejudo1234/dpo-qwen-cot-merged_exp09", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Honejudo1234/dpo-qwen-cot-merged_exp09
- SGLang
How to use Honejudo1234/dpo-qwen-cot-merged_exp09 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 "Honejudo1234/dpo-qwen-cot-merged_exp09" \ --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": "Honejudo1234/dpo-qwen-cot-merged_exp09", "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 "Honejudo1234/dpo-qwen-cot-merged_exp09" \ --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": "Honejudo1234/dpo-qwen-cot-merged_exp09", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Honejudo1234/dpo-qwen-cot-merged_exp09 with Docker Model Runner:
docker model run hf.co/Honejudo1234/dpo-qwen-cot-merged_exp09
qwen3-4b-dpo-qwen-cot-upsampled-merged
This model is a fine-tuned version of Qwen/Qwen3-4B-Instruct-2507 using Direct Preference Optimization (DPO) via the Unsloth library.
This repository contains the full-merged 16-bit weights. No adapter loading is required.
Dataset
Training Dataset: Honejudo1234/dpo-dataset-qwen-cot-upsampled
This dataset is an upsampled version of the original u-10bei/dpo-dataset-qwen-cot dataset. The upsampling was performed to address class imbalance and improve model performance on underrepresented categories.
Key details:
- Original dataset: u-10bei/dpo-dataset-qwen-cot
- Upsampled dataset: Honejudo1234/dpo-dataset-qwen-cot-upsampled
- Modification: Only upsampling (no content modification or data augmentation)
- Purpose: Balance training data distribution
Training Objective
This model has been optimized using DPO to align its responses with preferred outputs, focusing on improving reasoning (Chain-of-Thought) and structured response quality based on the provided preference dataset.
Training Configuration
Core Hyperparameters
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen3-4B-Instruct-2507 |
| Method | DPO (Direct Preference Optimization) |
| Learning Rate | 5e-07 |
| Beta | 0.2 |
| Epochs | 1 |
| Max Sequence Length | 1024 |
Batch Size Configuration
| Parameter | Value |
|---|---|
| Per Device Train Batch Size | 2 |
| Gradient Accumulation Steps | 4 |
| Effective Batch Size | 8 |
Note: The effective batch size is calculated as:
Effective Batch Size = per_device_batch_size × gradient_accumulation_steps × num_gpus
LoRA Configuration
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 8 |
| LoRA Alpha | 16 |
| LoRA Dropout | 0 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Status | Merged into base model (16-bit) |
Optimizer Settings
| Parameter | Value |
|---|---|
| Optimizer | OptimizerNames.ADAMW_8BIT |
| Weight Decay | 0.01 |
| Warmup Ratio | 0.1 |
Usage
Since this is a merged model, you can use it directly with transformers.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "your_id/your-repo-name"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Test inference
prompt = "Your question here"
inputs = tokenizer.apply_chat_template([{"role": "user", "content": prompt}], tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0]))
Sources & License (IMPORTANT)
- Original Dataset: u-10bei/dpo-dataset-qwen-cot
- Training Dataset (Upsampled): Honejudo1234/dpo-dataset-qwen-cot-upsampled
- License: MIT License. (As per dataset terms).
- Compliance: Users must follow the original base model's license terms.
- Downloads last month
- 8
Model tree for Honejudo1234/dpo-qwen-cot-merged_exp09
Base model
Qwen/Qwen3-4B-Instruct-2507