Views
No views yet

Qwen3.5-text-2B)bnb_4bit_quant_type=nf4, bnb_4bit_compute_dtype=bfloat16)lm_head.weight kept at bf16 for output quality / stability
| Model | Type | Base model |
|---|---|---|
| Qwen/Qwen3.5-2B | f16 · VLM · source | — |
| techwithsergiu/Qwen3.5-2B-bnb-4bit | BNB NF4 · VLM | Qwen/Qwen3.5-2B |
| techwithsergiu/Qwen3.5-text-2B | bf16 · text-only | Qwen/Qwen3.5-2B |
| techwithsergiu/Qwen3.5-text-2B-bnb-4bit | BNB NF4 · text-only | Qwen3.5-text-2B |
| techwithsergiu/Qwen3.5-text-2B-GGUF | GGUF quants | Qwen3.5-text-2B |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "techwithsergiu/Qwen3.5-text-2B-bnb-4bit"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 device_map="auto",
9 trust_remote_code=True,
10)
11
12messages = [{"role": "user", "content": "What is the capital of Romania?"}]
13
14# Thinking OFF — direct answer
15text = tokenizer.apply_chat_template(
16 messages,
17 tokenize=False,
18 add_generation_prompt=True,
19 enable_thinking=False,
20)
21inputs = tokenizer(text, return_tensors="pt").to(model.device)
22outputs = model.generate(**inputs, max_new_tokens=256)
23response = tokenizer.decode(
24 outputs[0][inputs["input_ids"].shape[1]:],
25 skip_special_tokens=True,
26)
27print(response)
28
29# Thinking ON — chain-of-thought before the answer
30text = tokenizer.apply_chat_template(
31 messages,
32 tokenize=False,
33 add_generation_prompt=True,
34 enable_thinking=True,
35)
36inputs = tokenizer(text, return_tensors="pt").to(model.device)
37outputs = model.generate(**inputs, max_new_tokens=1024)
38response = tokenizer.decode(
39 outputs[0][inputs["input_ids"].shape[1]:],
40 skip_special_tokens=True,
41)
42print(response)1# Quick start — install
2pip install "unsloth[cu124-torch260] @ git+https://github.com/unslothai/unsloth.git"
3pip install git+https://github.com/techwithsergiu/qwen-qlora-train.git
4
5# Train with a ready-made config
6qlora-train configs/qwen35/0.8b.yaml # or 2b / 4b1qlora-infer \
2 --model techwithsergiu/Qwen3.5-text-2B-bnb-4bit \
3 --adapter adapters/<run_name>
1@misc{qwen3.5,
2 title = {{Qwen3.5}: Towards Native Multimodal Agents},
3 author = {{Qwen Team}},
4 month = {February},
5 year = {2026},
6 url = {https://qwen.ai/blog?id=qwen3.5}
7}