Instructions to use Corning/qwen-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Corning/qwen-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Corning/qwen-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Corning/qwen-sft") model = AutoModelForCausalLM.from_pretrained("Corning/qwen-sft", 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 Corning/qwen-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Corning/qwen-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Corning/qwen-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Corning/qwen-sft
- SGLang
How to use Corning/qwen-sft 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 "Corning/qwen-sft" \ --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": "Corning/qwen-sft", "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 "Corning/qwen-sft" \ --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": "Corning/qwen-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Corning/qwen-sft with Docker Model Runner:
docker model run hf.co/Corning/qwen-sft
qwen-sft
Full-parameter SFT of Qwen/Qwen3-32B on a 6,962-trajectory subset of DR-Tulu-style deep-research agent data
(Datasearch/DR-AntiForget · dr_tulu_full_sft_6962.jsonl,
link).
The model is intended as the SFT baseline for the DR-AntiForget project, which studies catastrophic forgetting on deep-research agent capabilities.
Training
| Base | Qwen/Qwen3-32B |
| Method | full-parameter SFT |
| Framework | LLaMA-Factory + DeepSpeed ZeRO-3 (no offload) + FlashAttention-2 + Liger Kernel + sequence packing |
| Hardware | 1 node × 8 × NVIDIA H200 (140 GB) |
| Wall time | 19h 20m |
| Epochs | 5 |
| Optimizer | AdamW, lr 4e-5 (cosine, 10% warmup, weight decay 0) |
| Effective batch | 64 (mb 1 × grad-accum 8 × 8 GPUs) |
| Cutoff length | 32,768 tokens |
| Precision | bfloat16 |
| Trainable params | 32.76 B |
| Total steps | 285 (with packing; 1.92× compaction vs. raw) |
Data preprocessing
Raw dr_tulu_full_sft_6962.jsonl mean length is ≈19k Qwen tokens; ~13% of trajectories exceed 32k. To preserve as much of each trajectory as possible under a 32k cutoff, long trajectories are pre-compressed in place: middle <tool_response> bodies are replaced with a small JSON placeholder ({omitted, original_tokens, query, preview}) while keeping the first 1 and last 5 tool responses intact. This brings the >32k tail from 13.3% to 1.8% of the dataset.
Loss
| epoch | loss |
|---|---|
| 0.09 | 0.6409 |
| 1.05 | 0.3295 |
| 2.99 | 0.1547 |
| 3.07 | 0.0855 (post-epoch-3 boundary drop) |
| 4.04 | 0.0474 |
| 5.00 | 0.0257 |
Train loss only — no holdout was wired into this run, so be aware of likely overfit at epoch 5. If you have a held-out eval set, use it before deploying.
Quickstart
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
repo = "Corning/qwen-sft"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo, torch_dtype=torch.bfloat16, device_map="auto",
attn_implementation="flash_attention_2", trust_remote_code=True,
)
msgs = [
{"role": "system", "content": "You are a helpful research assistant."},
{"role": "user", "content": "Summarize catastrophic forgetting in one paragraph."},
]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
ids = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=512, temperature=0.6, top_p=0.95, top_k=20)
print(tok.decode(out[0, ids.input_ids.shape[1]:], skip_special_tokens=False))
Tool-use format
The model was trained on Qwen-native tool-use:
- Tool calls (assistant) wrapped in
<tool_call>...JSON...</tool_call> - Tool results (sent back as a
user-role message) wrapped in<tool_response>...JSON...</tool_response> - The
tool_responsespan is masked out of the loss (the model only learns to use tool results, not to predict them)
The shipped chat_template.jinja renders messages with tools=[...] correctly.
Files
- 14 sharded safetensors (~64 GB bf16)
chat_template.jinja, full tokenizer filesconfig.json,generation_config.jsontraining_loss.png,train_results.json,all_results.json(training metadata)inference.py(transformers + vLLM demo)
Framework versions
- Transformers 4.52.4
- Pytorch 2.6.0+cu124
- Datasets 3.6.0
- Tokenizers 0.21.1
License
Apache-2.0, inheriting from the base model.
- Downloads last month
- 2
Model tree for Corning/qwen-sft
Base model
Qwen/Qwen3-32B