Views
No views yet
Qwen/Qwen3.5-4Bchat_template.jinja, a custom Qwen3.5 template used
for both SFT rendering and inference. Unlike the stock history behavior, it
always replays non-empty assistant reasoning_content inside <think> blocks.
It also renders parallel tool calls with the XML-style Qwen tool-call format and
groups tool responses into the following user turn.AutoProcessor.from_pretrained() loads the bundled template. When serving with
SGLang, pass it explicitly to ensure training/inference parity:1python -m sglang.launch_server \
2 --model-path /path/to/model \
3 --chat-template /path/to/model/chat_template.jinja \
4 --reasoning-parser qwen3 \
5 --tool-call-parser qwen3_coderenable_thinking=False in the chat-template kwargs.1import torch
2from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration
3
4model_id = "/path/to/model"
5processor = AutoProcessor.from_pretrained(model_id)
6model = Qwen3_5ForConditionalGeneration.from_pretrained(
7 model_id,
8 torch_dtype=torch.bfloat16,
9 device_map="auto",
10)
11
12text = processor.apply_chat_template(
13 [{"role": "user", "content": "Describe the video."}],
14 tokenize=False,
15 add_generation_prompt=True,
16 enable_thinking=True,
17)