Views
No views yet
| Layer | Mechanism | What it blocks |
|---|---|---|
| 1 | Jinja set enable_thinking = false | <|think|> token never injected into prompt |
| 2 | System prompt instruction | Model instructed to never output <|channel>thought blocks |
| 3 | Empty thought-channel prefill | <|channel>thought\n\n<channel|> pre-closed at generation start |
1vllm serve tuandunghcmut/gemma-4-E2B-it-text-only-non-thinking \
2 --dtype bfloat16 \
3 --max-model-len 327681from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
4response = client.chat.completions.create(
5 model="gemma-4-E2B-it-text-only-non-thinking",
6 messages=[{"role": "user", "content": "What is the capital of Vietnam?"}],
7)
8print(response.choices[0].message.content)
9# → Direct answer, no thinking preamble1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model = AutoModelForCausalLM.from_pretrained(
5 "tuandunghcmut/gemma-4-E2B-it-text-only-non-thinking",
6 dtype=torch.bfloat16,
7 device_map="auto",
8)
9tok = AutoTokenizer.from_pretrained(
10 "tuandunghcmut/gemma-4-E2B-it-text-only-non-thinking"
11)
12
13messages = [{"role": "user", "content": "Explain transformer architecture briefly."}]
14prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
15
16inputs = tok(prompt, return_tensors="pt").to(model.device)
17out = model.generate(**inputs, max_new_tokens=256)
18print(tok.decode(out[0], skip_special_tokens=True))gemma-4-E2B-it-text-only-non-thinking | gemma-4-E4B-it-text-only-non-thinking | |
|---|---|---|
| Parameters | ~4.6B | ~7.5B |
| Hidden size | 1536 | 2560 |
| Layers | 35 | 42 |
| Non-thinking | ✅ 3-layer | ✅ 3-layer |
| VRAM (bf16) | ~9 GB | ~15 GB |