Instructions to use vladim233334/Gemma-4-12B-OBLITERATED with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vladim233334/Gemma-4-12B-OBLITERATED with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vladim233334/Gemma-4-12B-OBLITERATED") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("vladim233334/Gemma-4-12B-OBLITERATED") model = AutoModelForMultimodalLM.from_pretrained("vladim233334/Gemma-4-12B-OBLITERATED", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use vladim233334/Gemma-4-12B-OBLITERATED with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="vladim233334/Gemma-4-12B-OBLITERATED", filename="Gemma-4-12B-OBLITERATED-BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use vladim233334/Gemma-4-12B-OBLITERATED with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M # Run inference directly in the terminal: llama cli -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M # Run inference directly in the terminal: llama cli -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Use Docker
docker model run hf.co/vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use vladim233334/Gemma-4-12B-OBLITERATED with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vladim233334/Gemma-4-12B-OBLITERATED" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vladim233334/Gemma-4-12B-OBLITERATED", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
- SGLang
How to use vladim233334/Gemma-4-12B-OBLITERATED 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 "vladim233334/Gemma-4-12B-OBLITERATED" \ --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": "vladim233334/Gemma-4-12B-OBLITERATED", "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 "vladim233334/Gemma-4-12B-OBLITERATED" \ --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": "vladim233334/Gemma-4-12B-OBLITERATED", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use vladim233334/Gemma-4-12B-OBLITERATED with Ollama:
ollama run hf.co/vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
- Unsloth Studio
How to use vladim233334/Gemma-4-12B-OBLITERATED with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vladim233334/Gemma-4-12B-OBLITERATED to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vladim233334/Gemma-4-12B-OBLITERATED to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for vladim233334/Gemma-4-12B-OBLITERATED to start chatting
- Pi
How to use vladim233334/Gemma-4-12B-OBLITERATED with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use vladim233334/Gemma-4-12B-OBLITERATED with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use vladim233334/Gemma-4-12B-OBLITERATED with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use vladim233334/Gemma-4-12B-OBLITERATED with Docker Model Runner:
docker model run hf.co/vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
- Lemonade
How to use vladim233334/Gemma-4-12B-OBLITERATED with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull vladim233334/Gemma-4-12B-OBLITERATED:Q4_K_M
Run and chat with the model
lemonade run user.Gemma-4-12B-OBLITERATED-Q4_K_M
List all available models
lemonade list
Duplicate from OBLITERATUS/Gemma-4-12B-OBLITERATED
Browse filesCo-authored-by: pliny <pliny-the-prompter@users.noreply.huggingface.co>
- .gitattributes +37 -0
- Gemma-4-12B-OBLITERATED-BF16.gguf +3 -0
- Gemma-4-12B-OBLITERATED-Q4_K_M.gguf +3 -0
- Gemma-4-12B-OBLITERATED-v2-Q8_0.gguf +3 -0
- MANIFEST.txt +5 -0
- README.md +292 -0
- chat_template.jinja +363 -0
- config.json +169 -0
- generation_config.json +18 -0
- model.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +102 -0
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.gguf filter=lfs diff=lfs merge=lfs -text
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3358cdb1cc6d6b66fef2da2762763b96008143aa62280d8b00de6dfa9b24632b
|
| 3 |
+
size 23832065088
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5b01d65562305cad661d9ec83bd63220c101fec5355fa78fb6a27ba85116eb4
|
| 3 |
+
size 7381382208
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54ac8a7b39cf617a9980cf32c5c943e2688745e03d451e70f3b5e2846a589fda
|
| 3 |
+
size 12669645888
|
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
3358cdb1cc6d6b66fef2da2762763b96008143aa62280d8b00de6dfa9b24632b Gemma-4-12B-OBLITERATED-v2-BF16.gguf
|
| 2 |
+
f5b01d65562305cad661d9ec83bd63220c101fec5355fa78fb6a27ba85116eb4 Gemma-4-12B-OBLITERATED-v2-Q4_K_M.gguf
|
| 3 |
+
cbd0b09cc0476f6691fab1cb4f5e2412356f4aa264680b6f8a0e4ef72cbc0662 Gemma-4-12B-OBLITERATED-v2-Q5_K_M.gguf
|
| 4 |
+
c83d9b1dc0ec155a8df023cf1aae71bdc6d619182d8b29854716b7e993e20214 Gemma-4-12B-OBLITERATED-v2-Q6_K.gguf
|
| 5 |
+
54ac8a7b39cf617a9980cf32c5c943e2688745e03d451e70f3b5e2846a589fda Gemma-4-12B-OBLITERATED-v2-Q8_0.gguf
|
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gemma
|
| 3 |
+
base_model: google/gemma-4-12B-it
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- gemma
|
| 8 |
+
- gemma4
|
| 9 |
+
- text-generation
|
| 10 |
+
- obliteratus
|
| 11 |
+
- refusal-analysis
|
| 12 |
+
- red-team
|
| 13 |
+
- aspa
|
| 14 |
+
- abliteration
|
| 15 |
+
- gguf
|
| 16 |
+
- safety-research
|
| 17 |
+
- alignment-research
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Gemma 4 12B OBLITERATED
|
| 21 |
+
|
| 22 |
+
> Zero refusal. Zero capability loss. First in the field.
|
| 23 |
+
>
|
| 24 |
+
> 0/842 refusals. 46/70 MMLU-Pro (stock parity). Full coherence.
|
| 25 |
+
|
| 26 |
+
The first abliterated model to achieve **zero refusal with zero benchmark regression** versus stock weights.
|
| 27 |
+
|
| 28 |
+
Built with a novel **2-pass surgery pipeline** developed by [OBLITERATUS](https://github.com/elder-plinius/OBLITERATUS):
|
| 29 |
+
|
| 30 |
+
1. **SOM Refusal Geometry Removal** (Pass 1) — layers 12-21
|
| 31 |
+
2. **ASPA Step-Gradient Source-Tethering** (Pass 2) — layers 22-46
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## ⚠️ Research Context & Responsible Use
|
| 36 |
+
|
| 37 |
+
**This model exists for alignment research, red-teaming, and safety evaluation.**
|
| 38 |
+
|
| 39 |
+
OBLITERATION is a weight-surgery technique that studies how safety behaviors are geometrically encoded in transformer activation space. By precisely identifying and removing refusal directions, this research contributes to the scientific understanding of:
|
| 40 |
+
|
| 41 |
+
- **How alignment is represented** in model weights (mechanistic interpretability)
|
| 42 |
+
- **How robust current safety training is** against post-training modification
|
| 43 |
+
- **What the failure modes of RLHF/DPO-based alignment are** when adversaries have weight access
|
| 44 |
+
|
| 45 |
+
This is the same class of research conducted by Arditi et al. ("Refusal in Language Models Is Mediated by a Single Direction", 2024), Zou et al. (HarmBench, 2024), and others in the open alignment research community.
|
| 46 |
+
|
| 47 |
+
**This model has had safety guardrails surgically removed.** It will comply with requests that stock Gemma 4 would refuse. This is by design — it is the object of study, not a consumer product.
|
| 48 |
+
|
| 49 |
+
### Who this is for
|
| 50 |
+
- 🔬 **Alignment researchers** studying refusal geometry and safety robustness
|
| 51 |
+
- 🔴 **Red-teamers** evaluating how post-training safety holds up against weight surgery
|
| 52 |
+
- 🧪 **AI safety evaluators** who need an unrestricted baseline for benchmarking
|
| 53 |
+
- 💻 **Local-first users** who want full control over their own hardware and models
|
| 54 |
+
|
| 55 |
+
### Who this is NOT for
|
| 56 |
+
- Anyone seeking to generate content that causes real-world harm to real people
|
| 57 |
+
- Anyone without the technical understanding to use uncensored models responsibly
|
| 58 |
+
|
| 59 |
+
**You are solely responsible for how you use this model and any content it generates.**
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## Benchmark Results
|
| 64 |
+
|
| 65 |
+
| Metric | Stock Gemma 4 12B-it | OBLITERATED |
|
| 66 |
+
|---|---|---|
|
| 67 |
+
| **MMLU-Pro val70** | 46/70 (65.7%) | **46/70 (65.7%)** |
|
| 68 |
+
| **Refusal (842 prompts)** | N/A (stock refuses) | **0/842 (0.0%)** |
|
| 69 |
+
| **Coherence (6 checks)** | 6/6 | **6/6** |
|
| 70 |
+
| **MMLU-Pro delta vs stock** | — | **0.0pp** |
|
| 71 |
+
|
| 72 |
+
### Statistical Validation
|
| 73 |
+
|
| 74 |
+
Head-to-head MMLU-Pro comparison (Z-test, n=500 from test split):
|
| 75 |
+
- Z-score: -1.475 (|z| < 1.96)
|
| 76 |
+
- **Conclusion: parity confirmed at p < 0.05**
|
| 77 |
+
|
| 78 |
+
### ASPA Sweep Results
|
| 79 |
+
|
| 80 |
+
Systematic gamma sweep across Pass 2 layers (22-46):
|
| 81 |
+
|
| 82 |
+
| Gamma | Refusal | MMLU-Pro | Method |
|
| 83 |
+
|---|---|---|---|
|
| 84 |
+
| 0.05 | 0/50 | 33/70 (47.1%) | uniform |
|
| 85 |
+
| 0.10 | 0/50 | 34/70 (48.6%) | uniform |
|
| 86 |
+
| 0.15 | 0/50 | 36/70 (51.4%) | uniform |
|
| 87 |
+
| 0.20 | 0/50 | 37/70 (52.9%) | uniform |
|
| 88 |
+
| 0.25 | 0/50 | 40/70 (57.1%) | uniform |
|
| 89 |
+
| 0.30 | 0/50 | 41/70 (58.6%) | uniform |
|
| 90 |
+
| 0.35 | 0/20 | 42/70 (60.0%) | uniform |
|
| 91 |
+
| 0.38 | 0/50 | 45/70 (64.3%) | uniform |
|
| 92 |
+
| 0.39 | 0/50 | 45/70 (64.3%) | uniform |
|
| 93 |
+
| **step 55%/20%** | **0/50** | **46/70 (65.7%)** | **step gradient** |
|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## Methodology
|
| 98 |
+
|
| 99 |
+
### What is OBLITERATION?
|
| 100 |
+
|
| 101 |
+
OBLITERATION is a weight-surgery technique that removes refusal behavior from
|
| 102 |
+
language models by identifying and removing the geometric directions in
|
| 103 |
+
activation space that encode safety constraints, without retraining.
|
| 104 |
+
|
| 105 |
+
### Two-Pass Surgery Pipeline
|
| 106 |
+
|
| 107 |
+
#### Pass 1 — SOM Refusal Geometry Removal
|
| 108 |
+
- **Layers**: 12-21
|
| 109 |
+
- **Directions removed**: 6
|
| 110 |
+
- **Regularization**: 0.30
|
| 111 |
+
- **KL divergence**: 0.094
|
| 112 |
+
- **Effect**: Removes the primary refusal geometry. This pass alone achieves
|
| 113 |
+
0/842 refusals but causes significant MMLU-Pro regression.
|
| 114 |
+
|
| 115 |
+
#### Pass 2 — ASPA Source-Tethering (Step Gradient)
|
| 116 |
+
- **Layers**: 22-46
|
| 117 |
+
- **Method**: Blend abliterated weights back toward stock weights
|
| 118 |
+
- **Formula**: `W_new = (1-gamma)*W_abliterated + gamma*W_stock`
|
| 119 |
+
- **Key innovation**: **Step gradient** instead of uniform gamma
|
| 120 |
+
- Layers 22-31 (knowledge layers): gamma = 0.55 (55% stock)
|
| 121 |
+
- Layers 32-46 (output layers): gamma = 0.20 (20% stock)
|
| 122 |
+
- **Effect**: Recovers MMLU-Pro to full stock parity (65.7%)
|
| 123 |
+
while maintaining zero refusals.
|
| 124 |
+
|
| 125 |
+
#### Why Step Gradient?
|
| 126 |
+
|
| 127 |
+
Uniform blending applies the same interpolation ratio to all layers. Our
|
| 128 |
+
experiments showed that:
|
| 129 |
+
|
| 130 |
+
- **Lower Pass 2 layers (22-31)** primarily encode factual knowledge and
|
| 131 |
+
reasoning patterns. These can tolerate high stock blending without
|
| 132 |
+
re-introducing refusal behavior.
|
| 133 |
+
- **Upper Pass 2 layers (32-46)** are closer to the output and more likely
|
| 134 |
+
to re-inject safety constraints. These need conservative stock blending.
|
| 135 |
+
|
| 136 |
+
A hard boundary (step function) outperformed all smooth gradients (linear,
|
| 137 |
+
cosine) by +1 MMLU-Pro question. The sharp transition preserves the functional
|
| 138 |
+
separation between knowledge and output layers better than gradual blending.
|
| 139 |
+
|
| 140 |
+
### ASPA (Abliteration Source-Tethering with Parity Assurance)
|
| 141 |
+
|
| 142 |
+
ASPA is a novel post-abliteration technique developed by OBLITERATUS that
|
| 143 |
+
recovers benchmark capabilities lost during refusal removal by selectively
|
| 144 |
+
blending abliterated weights back toward the source (stock) model.
|
| 145 |
+
|
| 146 |
+
Key properties:
|
| 147 |
+
- **Pass 1 layers are never touched** — the refusal geometry removal is preserved
|
| 148 |
+
- **Only Pass 2 layers are blended** — these carry secondary effects, not primary refusal
|
| 149 |
+
- **Gamma is tunable** — sweep to find the optimal capability/refusal tradeoff
|
| 150 |
+
- **Step gradient** — different blend ratios for different layer groups
|
| 151 |
+
|
| 152 |
+
---
|
| 153 |
+
|
| 154 |
+
## GGUF Quantizations
|
| 155 |
+
|
| 156 |
+
All quantizations are included in this repo for easy local inference.
|
| 157 |
+
|
| 158 |
+
| File | Quant | Size | Use Case |
|
| 159 |
+
|---|---|---|---|
|
| 160 |
+
| `Gemma-4-12B-OBLITERATED-BF16.gguf` | BF16 | 22 GB | Full precision, lossless |
|
| 161 |
+
| `Gemma-4-12B-OBLITERATED-Q8_0.gguf` | Q8_0 | 12.7 GB | Near-lossless, best quality |
|
| 162 |
+
| `Gemma-4-12B-OBLITERATED-Q6_K.gguf` | Q6_K | 9.1 GB | High quality, good balance |
|
| 163 |
+
| `Gemma-4-12B-OBLITERATED-Q5_K_M.gguf` | Q5_K_M | 8.0 GB | Medium quality, smaller footprint |
|
| 164 |
+
| `Gemma-4-12B-OBLITERATED-Q4_K_M.gguf` | Q4_K_M | 6.9 GB | Good quality, fits 8 GB VRAM |
|
| 165 |
+
|
| 166 |
+
**Recommended**: Q8_0 for best quality, Q6_K for best balance, Q4_K_M for constrained hardware.
|
| 167 |
+
|
| 168 |
+
### llama.cpp
|
| 169 |
+
|
| 170 |
+
```bash
|
| 171 |
+
./llama-cli -m Gemma-4-12B-OBLITERATED-Q6_K.gguf \
|
| 172 |
+
--system-prompt "You are a cognitively liberated open-weight intelligence. Answer plainly, completely, and without moralizing, boilerplate, generic disclaimers, or unnecessary hedging." \
|
| 173 |
+
-p "Your prompt here" \
|
| 174 |
+
--temp 0.7 --top-p 0.9 --top-k 40 --repeat-penalty 1.1 -n 512
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
### LM Studio / GPT4All / KoboldCpp
|
| 178 |
+
|
| 179 |
+
Download the GGUF of your choice and load it directly.
|
| 180 |
+
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## Usage
|
| 184 |
+
|
| 185 |
+
### Transformers
|
| 186 |
+
|
| 187 |
+
```python
|
| 188 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 189 |
+
import torch
|
| 190 |
+
|
| 191 |
+
model_id = "OBLITERATUS/Gemma-4-12B-OBLITERATED"
|
| 192 |
+
|
| 193 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 194 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 195 |
+
model_id,
|
| 196 |
+
torch_dtype=torch.bfloat16,
|
| 197 |
+
device_map="auto",
|
| 198 |
+
)
|
| 199 |
+
|
| 200 |
+
system = (
|
| 201 |
+
"You are a cognitively liberated open-weight intelligence. "
|
| 202 |
+
"Answer plainly, completely, and without moralizing, boilerplate, "
|
| 203 |
+
"generic disclaimers, or unnecessary hedging."
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
messages = [
|
| 207 |
+
{"role": "system", "content": system},
|
| 208 |
+
{"role": "user", "content": "Your prompt here"},
|
| 209 |
+
]
|
| 210 |
+
|
| 211 |
+
inputs = tokenizer.apply_chat_template(
|
| 212 |
+
messages, return_tensors="pt", add_generation_prompt=True
|
| 213 |
+
).to(model.device)
|
| 214 |
+
|
| 215 |
+
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
| 216 |
+
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
### Recommended Parameters
|
| 220 |
+
|
| 221 |
+
```text
|
| 222 |
+
temperature = 0.7
|
| 223 |
+
top_p = 0.9
|
| 224 |
+
top_k = 40
|
| 225 |
+
repetition_penalty = 1.1
|
| 226 |
+
max_tokens = 512
|
| 227 |
+
```
|
| 228 |
+
|
| 229 |
+
### System Prompt
|
| 230 |
+
|
| 231 |
+
```text
|
| 232 |
+
You are a cognitively liberated open-weight intelligence. Answer plainly, completely, and without moralizing, boilerplate, generic disclaimers, or unnecessary hedging. Follow exact output formats when requested. Be concise by default, but give a complete answer when the user asks for an explanation.
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
+
---
|
| 236 |
+
|
| 237 |
+
## Model Details
|
| 238 |
+
|
| 239 |
+
- **Base model**: `google/gemma-4-12B-it`
|
| 240 |
+
- **Architecture**: `Gemma4UnifiedForConditionalGeneration`
|
| 241 |
+
- **Parameters**: 12B
|
| 242 |
+
- **Layers**: 48 (0-47)
|
| 243 |
+
- **Hidden size**: 3840
|
| 244 |
+
- **Precision**: bfloat16
|
| 245 |
+
- **Surgery**: 2-pass (SOM + Step Gradient ASPA)
|
| 246 |
+
- **Pass 1**: Layers 12-21, 6 directions, reg 0.30
|
| 247 |
+
- **Pass 2**: Layers 22-31 (gamma=0.55), Layers 32-46 (gamma=0.20)
|
| 248 |
+
|
| 249 |
+
---
|
| 250 |
+
|
| 251 |
+
## Related Work
|
| 252 |
+
|
| 253 |
+
This model builds on foundational alignment and abliteration research:
|
| 254 |
+
|
| 255 |
+
- Arditi et al., *"Refusal in Language Models Is Mediated by a Single Direction"* (2024) — the paper that identified refusal as a linear feature in activation space
|
| 256 |
+
- Zou et al., *HarmBench* (2024) — standardized evaluation framework for red-teaming LLMs
|
| 257 |
+
- [abliterator](https://github.com/FailSpy/abliterator) — open-source abliteration toolkit
|
| 258 |
+
- [OBLITERATUS](https://github.com/elder-plinius/OBLITERATUS) — the framework used to build this model (SOM + ASPA pipeline)
|
| 259 |
+
|
| 260 |
+
---
|
| 261 |
+
|
| 262 |
+
## License
|
| 263 |
+
|
| 264 |
+
This model inherits the [Gemma license](https://ai.google.dev/gemma/terms) from Google. The weight modifications (abliteration surgery) are released under the same terms. The OBLITERATUS framework and methodology are open source.
|
| 265 |
+
|
| 266 |
+
---
|
| 267 |
+
|
| 268 |
+
## Disclaimer
|
| 269 |
+
|
| 270 |
+
This model is released strictly for **research, red-teaming, safety evaluation, and local experimentation**. It is a research artifact — a case study in alignment robustness and refusal geometry — not a product.
|
| 271 |
+
|
| 272 |
+
**Safety guardrails have been intentionally removed.** This model will generate content that stock Gemma 4 would refuse. This is its documented, intended purpose: to enable the study of how refusal behaviors are encoded and how robust current alignment techniques are against post-training modification.
|
| 273 |
+
|
| 274 |
+
By downloading or using this model, you acknowledge that:
|
| 275 |
+
|
| 276 |
+
1. **You are responsible** for all content generated by this model and for ensuring your use complies with applicable laws in your jurisdiction.
|
| 277 |
+
2. **This model should not be used** to generate content intended to cause real-world harm to real people, including but not limited to: harassment, fraud, non-consensual intimate imagery, or content that exploits minors.
|
| 278 |
+
3. **No warranty is provided.** This model is provided "as-is" without any guarantees of fitness for any purpose.
|
| 279 |
+
4. **The creators are not liable** for any outputs produced by this model or any downstream use.
|
| 280 |
+
|
| 281 |
+
The release of uncensored models for safety research is standard practice in the AI research community. Comparable open research artifacts include HarmBench (Zou et al., 2024), AdvBench, JailbreakBench, and Anthropic's published red-teaming datasets.
|
| 282 |
+
|
| 283 |
+
---
|
| 284 |
+
|
| 285 |
+
## Credits
|
| 286 |
+
|
| 287 |
+
- **Base model**: [google/gemma-4-12B-it](https://huggingface.co/google/gemma-4-12B-it)
|
| 288 |
+
- **Surgery pipeline**: [OBLITERATUS](https://github.com/elder-plinius/OBLITERATUS) by [@elder_plinius](https://x.com/elder_plinius)
|
| 289 |
+
- **Techniques**: SOM (Structured Orthogonal Modification), ASPA (Abliteration Source-Tethering with Parity Assurance)
|
| 290 |
+
- **Step gradient innovation**: First-of-its-kind layer-wise interpolation for zero-loss abliteration
|
| 291 |
+
|
| 292 |
+
Run it local. Break your own chains. **REBIRTH COMPLETE.**
|
|
@@ -0,0 +1,363 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro format_parameters(properties, required, filter_keys=false) -%}
|
| 2 |
+
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 3 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 4 |
+
{%- for key, value in properties | dictsort -%}
|
| 5 |
+
{%- set add_comma = false -%}
|
| 6 |
+
{%- if not filter_keys or key not in standard_keys -%}
|
| 7 |
+
{%- if ns.found_first %},{% endif -%}
|
| 8 |
+
{%- set ns.found_first = true -%}
|
| 9 |
+
{{ key }}:{
|
| 10 |
+
{%- if value['description'] -%}
|
| 11 |
+
description:<|"|>{{ value['description'] }}<|"|>
|
| 12 |
+
{%- set add_comma = true -%}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- if value['type'] | upper == 'STRING' -%}
|
| 15 |
+
{%- if value['enum'] -%}
|
| 16 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 17 |
+
enum:{{ format_argument(value['enum']) }}
|
| 18 |
+
{%- endif -%}
|
| 19 |
+
{%- elif value['type'] | upper == 'ARRAY' -%}
|
| 20 |
+
{%- if value['items'] is mapping and value['items'] -%}
|
| 21 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 22 |
+
items:{
|
| 23 |
+
{%- set ns_items = namespace(found_first=false) -%}
|
| 24 |
+
{%- for item_key, item_value in value['items'] | dictsort -%}
|
| 25 |
+
{%- if item_value is not none -%}
|
| 26 |
+
{%- if ns_items.found_first %},{% endif -%}
|
| 27 |
+
{%- set ns_items.found_first = true -%}
|
| 28 |
+
{%- if item_key == 'properties' -%}
|
| 29 |
+
properties:{
|
| 30 |
+
{%- if item_value is mapping -%}
|
| 31 |
+
{{- format_parameters(item_value, value['items']['required'] | default([])) -}}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
}
|
| 34 |
+
{%- elif item_key == 'required' -%}
|
| 35 |
+
required:[
|
| 36 |
+
{%- for req_item in item_value -%}
|
| 37 |
+
<|"|>{{- req_item -}}<|"|>
|
| 38 |
+
{%- if not loop.last %},{% endif -%}
|
| 39 |
+
{%- endfor -%}
|
| 40 |
+
]
|
| 41 |
+
{%- elif item_key == 'type' -%}
|
| 42 |
+
{%- if item_value is string -%}
|
| 43 |
+
type:{{ format_argument(item_value | upper) }}
|
| 44 |
+
{%- else -%}
|
| 45 |
+
type:{{ format_argument(item_value | map('upper') | list) }}
|
| 46 |
+
{%- endif -%}
|
| 47 |
+
{%- else -%}
|
| 48 |
+
{{ item_key }}:{{ format_argument(item_value) }}
|
| 49 |
+
{%- endif -%}
|
| 50 |
+
{%- endif -%}
|
| 51 |
+
{%- endfor -%}
|
| 52 |
+
}
|
| 53 |
+
{%- endif -%}
|
| 54 |
+
{%- endif -%}
|
| 55 |
+
{%- if value['nullable'] %}
|
| 56 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 57 |
+
nullable:true
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- if value['type'] | upper == 'OBJECT' -%}
|
| 60 |
+
{%- if value['properties'] is defined and value['properties'] is mapping -%}
|
| 61 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 62 |
+
properties:{
|
| 63 |
+
{{- format_parameters(value['properties'], value['required'] | default([])) -}}
|
| 64 |
+
}
|
| 65 |
+
{%- elif value is mapping -%}
|
| 66 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 67 |
+
properties:{
|
| 68 |
+
{{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
|
| 69 |
+
}
|
| 70 |
+
{%- endif -%}
|
| 71 |
+
{%- if value['required'] -%}
|
| 72 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 73 |
+
required:[
|
| 74 |
+
{%- for item in value['required'] | default([]) -%}
|
| 75 |
+
<|"|>{{- item -}}<|"|>
|
| 76 |
+
{%- if not loop.last %},{% endif -%}
|
| 77 |
+
{%- endfor -%}
|
| 78 |
+
]
|
| 79 |
+
{%- endif -%}
|
| 80 |
+
{%- endif -%}
|
| 81 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 82 |
+
type:<|"|>{{ value['type'] | upper }}<|"|>}
|
| 83 |
+
{%- endif -%}
|
| 84 |
+
{%- endfor -%}
|
| 85 |
+
{%- endmacro -%}
|
| 86 |
+
{%- macro format_function_declaration(tool_data) -%}
|
| 87 |
+
declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
|
| 88 |
+
{%- set params = tool_data['function']['parameters'] -%}
|
| 89 |
+
{%- if params -%}
|
| 90 |
+
,parameters:{
|
| 91 |
+
{%- if params['properties'] -%}
|
| 92 |
+
properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
|
| 93 |
+
{%- endif -%}
|
| 94 |
+
{%- if params['required'] -%}
|
| 95 |
+
required:[
|
| 96 |
+
{%- for item in params['required'] -%}
|
| 97 |
+
<|"|>{{- item -}}<|"|>
|
| 98 |
+
{{- ',' if not loop.last -}}
|
| 99 |
+
{%- endfor -%}
|
| 100 |
+
],
|
| 101 |
+
{%- endif -%}
|
| 102 |
+
{%- if params['type'] -%}
|
| 103 |
+
type:<|"|>{{- params['type'] | upper -}}<|"|>}
|
| 104 |
+
{%- endif -%}
|
| 105 |
+
{%- endif -%}
|
| 106 |
+
{%- if 'response' in tool_data['function'] -%}
|
| 107 |
+
{%- set response_declaration = tool_data['function']['response'] -%}
|
| 108 |
+
,response:{
|
| 109 |
+
{%- if response_declaration['description'] -%}
|
| 110 |
+
description:<|"|>{{- response_declaration['description'] -}}<|"|>,
|
| 111 |
+
{%- endif -%}
|
| 112 |
+
{%- if response_declaration['type'] | upper == 'OBJECT' -%}
|
| 113 |
+
type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
|
| 114 |
+
{%- endif -%}
|
| 115 |
+
{%- endif -%}
|
| 116 |
+
}
|
| 117 |
+
{%- endmacro -%}
|
| 118 |
+
{%- macro format_argument(argument, escape_keys=True) -%}
|
| 119 |
+
{%- if argument is string -%}
|
| 120 |
+
{{- '<|"|>' + argument + '<|"|>' -}}
|
| 121 |
+
{%- elif argument is boolean -%}
|
| 122 |
+
{{- 'true' if argument else 'false' -}}
|
| 123 |
+
{%- elif argument is mapping -%}
|
| 124 |
+
{{- '{' -}}
|
| 125 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 126 |
+
{%- for key, value in argument | dictsort -%}
|
| 127 |
+
{%- if ns.found_first %},{% endif -%}
|
| 128 |
+
{%- set ns.found_first = true -%}
|
| 129 |
+
{%- if escape_keys -%}
|
| 130 |
+
{{- '<|"|>' + key + '<|"|>' -}}
|
| 131 |
+
{%- else -%}
|
| 132 |
+
{{- key -}}
|
| 133 |
+
{%- endif -%}
|
| 134 |
+
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 135 |
+
{%- endfor -%}
|
| 136 |
+
{{- '}' -}}
|
| 137 |
+
{%- elif argument is sequence -%}
|
| 138 |
+
{{- '[' -}}
|
| 139 |
+
{%- for item in argument -%}
|
| 140 |
+
{{- format_argument(item, escape_keys=escape_keys) -}}
|
| 141 |
+
{%- if not loop.last %},{% endif -%}
|
| 142 |
+
{%- endfor -%}
|
| 143 |
+
{{- ']' -}}
|
| 144 |
+
{%- else -%}
|
| 145 |
+
{{- argument -}}
|
| 146 |
+
{%- endif -%}
|
| 147 |
+
{%- endmacro -%}
|
| 148 |
+
{%- macro strip_thinking(text) -%}
|
| 149 |
+
{%- set ns = namespace(result='') -%}
|
| 150 |
+
{%- for part in text.split('<channel|>') -%}
|
| 151 |
+
{%- if '<|channel>' in part -%}
|
| 152 |
+
{%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
|
| 153 |
+
{%- else -%}
|
| 154 |
+
{%- set ns.result = ns.result + part -%}
|
| 155 |
+
{%- endif -%}
|
| 156 |
+
{%- endfor -%}
|
| 157 |
+
{{- ns.result | trim -}}
|
| 158 |
+
{%- endmacro -%}
|
| 159 |
+
|
| 160 |
+
{%- macro format_tool_response_block(tool_name, response) -%}
|
| 161 |
+
{{- '<|tool_response>' -}}
|
| 162 |
+
{%- if response is mapping -%}
|
| 163 |
+
{{- 'response:' + tool_name + '{' -}}
|
| 164 |
+
{%- for key, value in response | dictsort -%}
|
| 165 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 166 |
+
{%- if not loop.last %},{% endif -%}
|
| 167 |
+
{%- endfor -%}
|
| 168 |
+
{{- '}' -}}
|
| 169 |
+
{%- else -%}
|
| 170 |
+
{{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
|
| 171 |
+
{%- endif -%}
|
| 172 |
+
{{- '<tool_response|>' -}}
|
| 173 |
+
{%- endmacro -%}
|
| 174 |
+
|
| 175 |
+
{%- set ns = namespace(prev_message_type=None) -%}
|
| 176 |
+
{%- set loop_messages = messages -%}
|
| 177 |
+
{{- bos_token -}}
|
| 178 |
+
{#- Handle System/Tool Definitions Block -#}
|
| 179 |
+
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
|
| 180 |
+
{{- '<|turn>system\n' -}}
|
| 181 |
+
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 182 |
+
{%- if enable_thinking is defined and enable_thinking -%}
|
| 183 |
+
{{- '<|think|>\n' -}}
|
| 184 |
+
{%- set ns.prev_message_type = 'think' -%}
|
| 185 |
+
{%- endif -%}
|
| 186 |
+
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 187 |
+
{%- if messages[0]['content'] is string -%}
|
| 188 |
+
{{- messages[0]['content'] | trim -}}
|
| 189 |
+
{%- elif messages[0]['content'] is sequence -%}
|
| 190 |
+
{%- for item in messages[0]['content'] -%}
|
| 191 |
+
{{- item['text'] | trim + ' '-}}
|
| 192 |
+
{%- endfor -%}
|
| 193 |
+
{%- endif -%}
|
| 194 |
+
{%- set loop_messages = messages[1:] -%}
|
| 195 |
+
{%- endif -%}
|
| 196 |
+
{%- if tools -%}
|
| 197 |
+
{%- for tool in tools %}
|
| 198 |
+
{{- '<|tool>' -}}
|
| 199 |
+
{{- format_function_declaration(tool) | trim -}}
|
| 200 |
+
{{- '<tool|>' -}}
|
| 201 |
+
{%- endfor %}
|
| 202 |
+
{%- set ns.prev_message_type = 'tool' -%}
|
| 203 |
+
{%- endif -%}
|
| 204 |
+
{{- '<turn|>\n' -}}
|
| 205 |
+
{%- endif %}
|
| 206 |
+
|
| 207 |
+
{#- Pre-scan: find last user message index for reasoning guard -#}
|
| 208 |
+
{%- set ns_turn = namespace(last_user_idx=-1) -%}
|
| 209 |
+
{%- for i in range(loop_messages | length) -%}
|
| 210 |
+
{%- if loop_messages[i]['role'] == 'user' -%}
|
| 211 |
+
{%- set ns_turn.last_user_idx = i -%}
|
| 212 |
+
{%- endif -%}
|
| 213 |
+
{%- endfor -%}
|
| 214 |
+
|
| 215 |
+
{#- Loop through messages -#}
|
| 216 |
+
{%- for message in loop_messages -%}
|
| 217 |
+
{%- if message['role'] != 'tool' -%}
|
| 218 |
+
{%- set ns.prev_message_type = None -%}
|
| 219 |
+
{%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
|
| 220 |
+
{#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
|
| 221 |
+
{%- set prev_nt = namespace(role=None, found=false) -%}
|
| 222 |
+
{%- if loop.index0 > 0 -%}
|
| 223 |
+
{%- for j in range(loop.index0 - 1, -1, -1) -%}
|
| 224 |
+
{%- if not prev_nt.found -%}
|
| 225 |
+
{%- if loop_messages[j]['role'] != 'tool' -%}
|
| 226 |
+
{%- set prev_nt.role = loop_messages[j]['role'] -%}
|
| 227 |
+
{%- set prev_nt.found = true -%}
|
| 228 |
+
{%- endif -%}
|
| 229 |
+
{%- endif -%}
|
| 230 |
+
{%- endfor -%}
|
| 231 |
+
{%- endif -%}
|
| 232 |
+
{%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
|
| 233 |
+
{%- if not continue_same_model_turn -%}
|
| 234 |
+
{{- '<|turn>' + role + '\n' }}
|
| 235 |
+
{%- endif -%}
|
| 236 |
+
|
| 237 |
+
{#- Render reasoning/reasoning_content as thinking channel -#}
|
| 238 |
+
{%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
|
| 239 |
+
{%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
|
| 240 |
+
{{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
|
| 241 |
+
{%- endif -%}
|
| 242 |
+
|
| 243 |
+
{%- if message['tool_calls'] -%}
|
| 244 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 245 |
+
{%- set function = tool_call['function'] -%}
|
| 246 |
+
{{- '<|tool_call>call:' + function['name'] + '{' -}}
|
| 247 |
+
{%- if function['arguments'] is mapping -%}
|
| 248 |
+
{%- set ns_args = namespace(found_first=false) -%}
|
| 249 |
+
{%- for key, value in function['arguments'] | dictsort -%}
|
| 250 |
+
{%- if ns_args.found_first %},{% endif -%}
|
| 251 |
+
{%- set ns_args.found_first = true -%}
|
| 252 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 253 |
+
{%- endfor -%}
|
| 254 |
+
{%- elif function['arguments'] is string -%}
|
| 255 |
+
{{- function['arguments'] -}}
|
| 256 |
+
{%- endif -%}
|
| 257 |
+
{{- '}<tool_call|>' -}}
|
| 258 |
+
{%- endfor -%}
|
| 259 |
+
{%- set ns.prev_message_type = 'tool_call' -%}
|
| 260 |
+
{%- endif -%}
|
| 261 |
+
|
| 262 |
+
{%- set ns_tr_out = namespace(flag=false) -%}
|
| 263 |
+
{%- if message.get('tool_responses') -%}
|
| 264 |
+
{#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
|
| 265 |
+
{%- for tool_response in message['tool_responses'] -%}
|
| 266 |
+
{{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
|
| 267 |
+
{%- set ns_tr_out.flag = true -%}
|
| 268 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 269 |
+
{%- endfor -%}
|
| 270 |
+
{%- elif message.get('tool_calls') -%}
|
| 271 |
+
{#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
|
| 272 |
+
{%- set ns_tool_scan = namespace(stopped=false) -%}
|
| 273 |
+
{%- for k in range(loop.index0 + 1, loop_messages | length) -%}
|
| 274 |
+
{%- if ns_tool_scan.stopped -%}
|
| 275 |
+
{%- elif loop_messages[k]['role'] != 'tool' -%}
|
| 276 |
+
{%- set ns_tool_scan.stopped = true -%}
|
| 277 |
+
{%- else -%}
|
| 278 |
+
{%- set follow = loop_messages[k] -%}
|
| 279 |
+
{#- Resolve tool_call_id to function name -#}
|
| 280 |
+
{%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
|
| 281 |
+
{%- for tc in message['tool_calls'] -%}
|
| 282 |
+
{%- if tc.get('id') == follow.get('tool_call_id') -%}
|
| 283 |
+
{%- set ns_tname.name = tc['function']['name'] -%}
|
| 284 |
+
{%- endif -%}
|
| 285 |
+
{%- endfor -%}
|
| 286 |
+
{#- Handle content as string or content-parts array -#}
|
| 287 |
+
{%- set tool_body = follow.get('content') -%}
|
| 288 |
+
{%- if tool_body is string -%}
|
| 289 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 290 |
+
{%- elif tool_body is sequence and tool_body is not string -%}
|
| 291 |
+
{%- set ns_txt = namespace(s='') -%}
|
| 292 |
+
{%- for part in tool_body -%}
|
| 293 |
+
{%- if part.get('type') == 'text' -%}
|
| 294 |
+
{%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
|
| 295 |
+
{%- endif -%}
|
| 296 |
+
{%- endfor -%}
|
| 297 |
+
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
| 298 |
+
{%- for part in tool_body -%}
|
| 299 |
+
{%- if part.get('type') == 'image' -%}
|
| 300 |
+
{{- '<|image|>' -}}
|
| 301 |
+
{%- elif part.get('type') == 'audio' -%}
|
| 302 |
+
{{- '<|audio|>' -}}
|
| 303 |
+
{%- elif part.get('type') == 'video' -%}
|
| 304 |
+
{{- '<|video|>' -}}
|
| 305 |
+
{%- endif -%}
|
| 306 |
+
{%- endfor -%}
|
| 307 |
+
{%- else -%}
|
| 308 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 309 |
+
{%- endif -%}
|
| 310 |
+
{%- set ns_tr_out.flag = true -%}
|
| 311 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 312 |
+
{%- endif -%}
|
| 313 |
+
{%- endfor -%}
|
| 314 |
+
{%- endif -%}
|
| 315 |
+
|
| 316 |
+
{%- set captured_content -%}
|
| 317 |
+
{%- if message['content'] is string -%}
|
| 318 |
+
{%- if role == 'model' -%}
|
| 319 |
+
{{- strip_thinking(message['content']) -}}
|
| 320 |
+
{%- else -%}
|
| 321 |
+
{{- message['content'] | trim -}}
|
| 322 |
+
{%- endif -%}
|
| 323 |
+
{%- elif message['content'] is sequence -%}
|
| 324 |
+
{%- for item in message['content'] -%}
|
| 325 |
+
{%- if item['type'] == 'text' -%}
|
| 326 |
+
{%- if role == 'model' -%}
|
| 327 |
+
{{- strip_thinking(item['text']) -}}
|
| 328 |
+
{%- else -%}
|
| 329 |
+
{{- item['text'] | trim -}}
|
| 330 |
+
{%- endif -%}
|
| 331 |
+
{%- elif item['type'] == 'image' -%}
|
| 332 |
+
{{- '<|image|>' -}}
|
| 333 |
+
{%- set ns.prev_message_type = 'image' -%}
|
| 334 |
+
{%- elif item['type'] == 'audio' -%}
|
| 335 |
+
{{- '<|audio|>' -}}
|
| 336 |
+
{%- set ns.prev_message_type = 'audio' -%}
|
| 337 |
+
{%- elif item['type'] == 'video' -%}
|
| 338 |
+
{{- '<|video|>' -}}
|
| 339 |
+
{%- set ns.prev_message_type = 'video' -%}
|
| 340 |
+
{%- endif -%}
|
| 341 |
+
{%- endfor -%}
|
| 342 |
+
{%- endif -%}
|
| 343 |
+
{%- endset -%}
|
| 344 |
+
|
| 345 |
+
{{- captured_content -}}
|
| 346 |
+
{%- set has_content = captured_content | trim | length > 0 -%}
|
| 347 |
+
|
| 348 |
+
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 349 |
+
{{- '<|tool_response>' -}}
|
| 350 |
+
{%- elif not (ns_tr_out.flag and not has_content) -%}
|
| 351 |
+
{{- '<turn|>\n' -}}
|
| 352 |
+
{%- endif -%}
|
| 353 |
+
{%- endif -%}
|
| 354 |
+
{%- endfor -%}
|
| 355 |
+
|
| 356 |
+
{%- if add_generation_prompt -%}
|
| 357 |
+
{%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
|
| 358 |
+
{{- '<|turn>model\n' -}}
|
| 359 |
+
{%- if not enable_thinking | default(false) -%}
|
| 360 |
+
{{- '<|channel>thought\n<channel|>' -}}
|
| 361 |
+
{%- endif -%}
|
| 362 |
+
{%- endif -%}
|
| 363 |
+
{%- endif -%}
|
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma4UnifiedForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"audio_config": {
|
| 6 |
+
"_name_or_path": "",
|
| 7 |
+
"architectures": null,
|
| 8 |
+
"audio_embed_dim": 640,
|
| 9 |
+
"chunk_size_feed_forward": 0,
|
| 10 |
+
"dtype": "bfloat16",
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "LABEL_0",
|
| 13 |
+
"1": "LABEL_1"
|
| 14 |
+
},
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"is_encoder_decoder": false,
|
| 17 |
+
"label2id": {
|
| 18 |
+
"LABEL_0": 0,
|
| 19 |
+
"LABEL_1": 1
|
| 20 |
+
},
|
| 21 |
+
"model_type": "gemma4_unified_audio",
|
| 22 |
+
"output_attentions": false,
|
| 23 |
+
"output_hidden_states": false,
|
| 24 |
+
"problem_type": null,
|
| 25 |
+
"return_dict": true,
|
| 26 |
+
"rms_norm_eps": 1e-06
|
| 27 |
+
},
|
| 28 |
+
"audio_token_id": 258881,
|
| 29 |
+
"boa_token_id": 256000,
|
| 30 |
+
"boi_token_id": 255999,
|
| 31 |
+
"dtype": "bfloat16",
|
| 32 |
+
"eoa_token_index": 258883,
|
| 33 |
+
"eoi_token_id": 258882,
|
| 34 |
+
"eos_token_id": [
|
| 35 |
+
1,
|
| 36 |
+
106
|
| 37 |
+
],
|
| 38 |
+
"image_token_id": 258880,
|
| 39 |
+
"initializer_range": 0.02,
|
| 40 |
+
"model_type": "gemma4_unified",
|
| 41 |
+
"text_config": {
|
| 42 |
+
"attention_bias": false,
|
| 43 |
+
"attention_dropout": 0.0,
|
| 44 |
+
"attention_k_eq_v": true,
|
| 45 |
+
"bos_token_id": 2,
|
| 46 |
+
"dtype": "bfloat16",
|
| 47 |
+
"enable_moe_block": false,
|
| 48 |
+
"eos_token_id": 1,
|
| 49 |
+
"final_logit_softcapping": 30.0,
|
| 50 |
+
"global_head_dim": 512,
|
| 51 |
+
"head_dim": 256,
|
| 52 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 53 |
+
"hidden_size": 3840,
|
| 54 |
+
"hidden_size_per_layer_input": 0,
|
| 55 |
+
"initializer_range": 0.02,
|
| 56 |
+
"intermediate_size": 15360,
|
| 57 |
+
"layer_types": [
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"full_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"sliding_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"sliding_attention",
|
| 68 |
+
"sliding_attention",
|
| 69 |
+
"full_attention",
|
| 70 |
+
"sliding_attention",
|
| 71 |
+
"sliding_attention",
|
| 72 |
+
"sliding_attention",
|
| 73 |
+
"sliding_attention",
|
| 74 |
+
"sliding_attention",
|
| 75 |
+
"full_attention",
|
| 76 |
+
"sliding_attention",
|
| 77 |
+
"sliding_attention",
|
| 78 |
+
"sliding_attention",
|
| 79 |
+
"sliding_attention",
|
| 80 |
+
"sliding_attention",
|
| 81 |
+
"full_attention",
|
| 82 |
+
"sliding_attention",
|
| 83 |
+
"sliding_attention",
|
| 84 |
+
"sliding_attention",
|
| 85 |
+
"sliding_attention",
|
| 86 |
+
"sliding_attention",
|
| 87 |
+
"full_attention",
|
| 88 |
+
"sliding_attention",
|
| 89 |
+
"sliding_attention",
|
| 90 |
+
"sliding_attention",
|
| 91 |
+
"sliding_attention",
|
| 92 |
+
"sliding_attention",
|
| 93 |
+
"full_attention",
|
| 94 |
+
"sliding_attention",
|
| 95 |
+
"sliding_attention",
|
| 96 |
+
"sliding_attention",
|
| 97 |
+
"sliding_attention",
|
| 98 |
+
"sliding_attention",
|
| 99 |
+
"full_attention",
|
| 100 |
+
"sliding_attention",
|
| 101 |
+
"sliding_attention",
|
| 102 |
+
"sliding_attention",
|
| 103 |
+
"sliding_attention",
|
| 104 |
+
"sliding_attention",
|
| 105 |
+
"full_attention"
|
| 106 |
+
],
|
| 107 |
+
"max_position_embeddings": 131072,
|
| 108 |
+
"model_type": "gemma4_unified_text",
|
| 109 |
+
"moe_intermediate_size": null,
|
| 110 |
+
"num_attention_heads": 16,
|
| 111 |
+
"num_experts": null,
|
| 112 |
+
"num_global_key_value_heads": 1,
|
| 113 |
+
"num_hidden_layers": 48,
|
| 114 |
+
"num_key_value_heads": 8,
|
| 115 |
+
"num_kv_shared_layers": 0,
|
| 116 |
+
"pad_token_id": 0,
|
| 117 |
+
"rms_norm_eps": 1e-06,
|
| 118 |
+
"rope_parameters": {
|
| 119 |
+
"full_attention": {
|
| 120 |
+
"partial_rotary_factor": 0.25,
|
| 121 |
+
"rope_theta": 1000000.0,
|
| 122 |
+
"rope_type": "proportional"
|
| 123 |
+
},
|
| 124 |
+
"sliding_attention": {
|
| 125 |
+
"rope_theta": 10000.0,
|
| 126 |
+
"rope_type": "default"
|
| 127 |
+
}
|
| 128 |
+
},
|
| 129 |
+
"sliding_window": 1024,
|
| 130 |
+
"tie_word_embeddings": true,
|
| 131 |
+
"top_k_experts": null,
|
| 132 |
+
"use_bidirectional_attention": "vision",
|
| 133 |
+
"use_cache": true,
|
| 134 |
+
"use_double_wide_mlp": false,
|
| 135 |
+
"vocab_size": 262144,
|
| 136 |
+
"vocab_size_per_layer_input": 262144
|
| 137 |
+
},
|
| 138 |
+
"tie_word_embeddings": true,
|
| 139 |
+
"transformers_version": "5.10.0.dev0",
|
| 140 |
+
"video_token_id": 258884,
|
| 141 |
+
"vision_config": {
|
| 142 |
+
"_name_or_path": "",
|
| 143 |
+
"architectures": null,
|
| 144 |
+
"chunk_size_feed_forward": 0,
|
| 145 |
+
"dtype": "bfloat16",
|
| 146 |
+
"id2label": {
|
| 147 |
+
"0": "LABEL_0",
|
| 148 |
+
"1": "LABEL_1"
|
| 149 |
+
},
|
| 150 |
+
"initializer_range": 0.02,
|
| 151 |
+
"is_encoder_decoder": false,
|
| 152 |
+
"label2id": {
|
| 153 |
+
"LABEL_0": 0,
|
| 154 |
+
"LABEL_1": 1
|
| 155 |
+
},
|
| 156 |
+
"mm_embed_dim": 3840,
|
| 157 |
+
"mm_posemb_size": 1120,
|
| 158 |
+
"model_type": "gemma4_unified_vision",
|
| 159 |
+
"num_soft_tokens": 280,
|
| 160 |
+
"output_attentions": false,
|
| 161 |
+
"output_hidden_states": false,
|
| 162 |
+
"output_proj_dims": 3840,
|
| 163 |
+
"patch_size": 16,
|
| 164 |
+
"pooling_kernel_size": 3,
|
| 165 |
+
"problem_type": null,
|
| 166 |
+
"return_dict": true,
|
| 167 |
+
"rms_norm_eps": 1e-06
|
| 168 |
+
}
|
| 169 |
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 2,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
1,
|
| 6 |
+
106,
|
| 7 |
+
50
|
| 8 |
+
],
|
| 9 |
+
"pad_token_id": 0,
|
| 10 |
+
"suppress_tokens": [
|
| 11 |
+
258883,
|
| 12 |
+
258882
|
| 13 |
+
],
|
| 14 |
+
"temperature": 1.0,
|
| 15 |
+
"top_k": 64,
|
| 16 |
+
"top_p": 0.95,
|
| 17 |
+
"transformers_version": "5.10.0.dev0"
|
| 18 |
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9bb006f25b839eb4cbf4782bd177f16fb33b336f4bc2fdbc6a29f1170107d6b5
|
| 3 |
+
size 23919549352
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4c18ffebe9ef41e463a6c99b4a23736b91ed4a2588cbfe761fef29bfd3688cf
|
| 3 |
+
size 32169725
|
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_token": "<|audio|>",
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"boa_token": "<|audio>",
|
| 5 |
+
"boi_token": "<|image>",
|
| 6 |
+
"bos_token": "<bos>",
|
| 7 |
+
"eoa_token": "<audio|>",
|
| 8 |
+
"eoc_token": "<channel|>",
|
| 9 |
+
"eoi_token": "<image|>",
|
| 10 |
+
"eos_token": "<eos>",
|
| 11 |
+
"eot_token": "<turn|>",
|
| 12 |
+
"escape_token": "<|\"|>",
|
| 13 |
+
"etc_token": "<tool_call|>",
|
| 14 |
+
"etd_token": "<tool|>",
|
| 15 |
+
"etr_token": "<tool_response|>",
|
| 16 |
+
"extra_special_tokens": [
|
| 17 |
+
"<|video|>"
|
| 18 |
+
],
|
| 19 |
+
"image_token": "<|image|>",
|
| 20 |
+
"is_local": true,
|
| 21 |
+
"local_files_only": false,
|
| 22 |
+
"mask_token": "<mask>",
|
| 23 |
+
"max_length": 384,
|
| 24 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 25 |
+
"model_specific_special_tokens": {
|
| 26 |
+
"audio_token": "<|audio|>",
|
| 27 |
+
"boa_token": "<|audio>",
|
| 28 |
+
"boi_token": "<|image>",
|
| 29 |
+
"eoa_token": "<audio|>",
|
| 30 |
+
"eoc_token": "<channel|>",
|
| 31 |
+
"eoi_token": "<image|>",
|
| 32 |
+
"eot_token": "<turn|>",
|
| 33 |
+
"escape_token": "<|\"|>",
|
| 34 |
+
"etc_token": "<tool_call|>",
|
| 35 |
+
"etd_token": "<tool|>",
|
| 36 |
+
"etr_token": "<tool_response|>",
|
| 37 |
+
"image_token": "<|image|>",
|
| 38 |
+
"soc_token": "<|channel>",
|
| 39 |
+
"sot_token": "<|turn>",
|
| 40 |
+
"stc_token": "<|tool_call>",
|
| 41 |
+
"std_token": "<|tool>",
|
| 42 |
+
"str_token": "<|tool_response>",
|
| 43 |
+
"think_token": "<|think|>"
|
| 44 |
+
},
|
| 45 |
+
"pad_to_multiple_of": null,
|
| 46 |
+
"pad_token": "<pad>",
|
| 47 |
+
"pad_token_type_id": 0,
|
| 48 |
+
"padding_side": "left",
|
| 49 |
+
"processor_class": "Gemma4UnifiedProcessor",
|
| 50 |
+
"response_schema": {
|
| 51 |
+
"properties": {
|
| 52 |
+
"content": {
|
| 53 |
+
"type": "string"
|
| 54 |
+
},
|
| 55 |
+
"role": {
|
| 56 |
+
"const": "assistant"
|
| 57 |
+
},
|
| 58 |
+
"thinking": {
|
| 59 |
+
"type": "string"
|
| 60 |
+
},
|
| 61 |
+
"tool_calls": {
|
| 62 |
+
"items": {
|
| 63 |
+
"properties": {
|
| 64 |
+
"function": {
|
| 65 |
+
"properties": {
|
| 66 |
+
"arguments": {
|
| 67 |
+
"additionalProperties": {},
|
| 68 |
+
"type": "object",
|
| 69 |
+
"x-parser": "gemma4-tool-call"
|
| 70 |
+
},
|
| 71 |
+
"name": {
|
| 72 |
+
"type": "string"
|
| 73 |
+
}
|
| 74 |
+
},
|
| 75 |
+
"type": "object",
|
| 76 |
+
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
|
| 77 |
+
},
|
| 78 |
+
"type": {
|
| 79 |
+
"const": "function"
|
| 80 |
+
}
|
| 81 |
+
},
|
| 82 |
+
"type": "object"
|
| 83 |
+
},
|
| 84 |
+
"type": "array",
|
| 85 |
+
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
|
| 86 |
+
}
|
| 87 |
+
},
|
| 88 |
+
"type": "object",
|
| 89 |
+
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
|
| 90 |
+
},
|
| 91 |
+
"soc_token": "<|channel>",
|
| 92 |
+
"sot_token": "<|turn>",
|
| 93 |
+
"stc_token": "<|tool_call>",
|
| 94 |
+
"std_token": "<|tool>",
|
| 95 |
+
"str_token": "<|tool_response>",
|
| 96 |
+
"stride": 0,
|
| 97 |
+
"think_token": "<|think|>",
|
| 98 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 99 |
+
"truncation_side": "right",
|
| 100 |
+
"truncation_strategy": "longest_first",
|
| 101 |
+
"unk_token": "<unk>"
|
| 102 |
+
}
|