Views
No views yet
| Original VLM | Text-Only | |
|---|---|---|
| Architecture | Qwen3_5ForConditionalGeneration | Qwen3_5ForCausalLM |
| Vision tower | 27-layer ViT (~0.85 GB) | ❌ Removed |
| Text backbone | 32 layers, 4096 hidden, 9B params | ✅ Identical |
| Disk size | ~18.8 GB | ~17.1 GB |
| VRAM (bf16) | ~18.5 GB | ~17.1 GB |
| VRAM (4-bit) | — | ~5 GB |
--mode f16<think>...</think> chain-of-thoughtpip install transformers>=4.50 bitsandbytes torch1from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
2import torch
3
4model_path = "your-username/Qwen3.5-9B-Text-Only-abliterated" # or local path
5
6tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
7
8model = AutoModelForCausalLM.from_pretrained(
9 model_path,
10 quantization_config=BitsAndBytesConfig(
11 load_in_4bit=True,
12 bnb_4bit_compute_dtype=torch.bfloat16,
13 bnb_4bit_use_double_quant=True,
14 bnb_4bit_quant_type="nf4",
15 ),
16 device_map="auto",
17 trust_remote_code=True,
18)
19
20messages = [
21 {"role": "user", "content": "你好,请用一句话介绍你自己。"},
22]
23prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
24
25inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
26outputs = model.generate(
27 **inputs,
28 max_new_tokens=256,
29 do_sample=True,
30 temperature=0.7,
31 top_p=0.9,
32 eos_token_id=tokenizer.eos_token_id,
33 pad_token_id=tokenizer.pad_token_id,
34)
35print(tokenizer.decode(outputs[0], skip_special_tokens=True))1model = AutoModelForCausalLM.from_pretrained(
2 model_path,
3 torch_dtype=torch.bfloat16,
4 trust_remote_code=True,
5)⚠️ Do not usedevice_map="auto"with bf16 unless your GPU has ≥18 GB VRAM. The accelerate offloading leaves some layers on "meta device", producing garbled output.
<|im_start|>user
你的问题<|im_end|>
<|im_start|>assistant
<think>
[模型在这里进行思维链推理]
</think>
[最终回答]tokenizer.apply_chat_template() method handles this automatically. Do not feed raw text directly.1# 1. Install toolkit
2pip install git+https://github.com/techwithsergiu/qwen35-toolkit.git
3
4# 2. Strip vision tower
5qwen35-strip \
6 --model ./Huihui-Qwopus3.5-9B-v3-abliterated \
7 --output ./Qwen3.5-9B-Text-Only-abliterated \
8 --mode f16model.visual.* and related tensors from safetensors shardsvision_config from config.json, sets architecture to Qwen3_5ForCausalLM<think> block first. Use skip_special_tokens=False if you want to inspect the reasoning chain.