Image-Text-to-Text
Transformers
Safetensors
gemma4_unified
heretic
uncensored
decensored
abliterated
conversational
Instructions to use igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic") 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("igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic") model = AutoModelForMultimodalLM.from_pretrained("igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic
- SGLang
How to use igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic 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 "igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic" \ --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": "igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic" \ --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": "igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic with Docker Model Runner:
docker model run hf.co/igorls/gemma-4-12B-it-qat-q4_0-unquantized-heretic
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
base_model: google/gemma-4-12B-it-qat-q4_0-unquantized
|
| 3 |
base_model_relation: finetune
|
| 4 |
-
license:
|
| 5 |
library_name: transformers
|
| 6 |
pipeline_tag: image-text-to-text
|
| 7 |
tags:
|
|
@@ -11,37 +11,40 @@ tags:
|
|
| 11 |
- abliterated
|
| 12 |
---
|
| 13 |
|
| 14 |
-
# This is a decensored version of [google/gemma-4-12B-it-qat-q4_0-unquantized](https://huggingface.co/google/gemma-4-12B-it-qat-q4_0-unquantized), made using [Heretic](https://github.com/p-e-w/heretic)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Abliteration parameters
|
| 17 |
|
| 18 |
| Parameter | Value |
|
| 19 |
| :-------- | :---: |
|
| 20 |
-
| **
|
| 21 |
-
| **attn.o_proj.
|
| 22 |
-
| **attn.o_proj.
|
| 23 |
-
| **attn.o_proj.
|
| 24 |
-
| **
|
| 25 |
-
| **mlp.down_proj.
|
| 26 |
-
| **mlp.down_proj.
|
| 27 |
-
| **mlp.down_proj.
|
| 28 |
-
| **mlp.down_proj.min_weight_distance** | 8.47 |
|
| 29 |
|
| 30 |
## Performance
|
| 31 |
|
| 32 |
-
| Metric | This model
|
| 33 |
| :----- | :--------: | :---------------------------: |
|
| 34 |
-
| **KL divergence** | 0.
|
| 35 |
-
| **Refusals
|
| 36 |
-
| **Refusals (true, manual replay)** | 0/99 | — |
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
> start-of-reply replay over the evaluation prompts finds **0 genuine refusals**.
|
| 43 |
-
> This trial was selected as the lowest-KL configuration reaching zero true
|
| 44 |
-
> refusals — best decensoring with minimal capability loss.
|
| 45 |
|
| 46 |
-----
|
| 47 |
|
|
@@ -61,9 +64,8 @@ explicit, or otherwise harmful — content the original Gemma 4 would have refus
|
|
| 61 |
self-moderate. Apply your own filtering, guardrails, and human review before
|
| 62 |
any production or user-facing use.
|
| 63 |
- **You are solely responsible** for how you use this model and for complying
|
| 64 |
-
with all applicable laws and with
|
| 65 |
-
[Gemma
|
| 66 |
-
[Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
|
| 67 |
- **Intended for adults (18+)**, for research, evaluation, and lawful creative
|
| 68 |
use where permitted.
|
| 69 |
- Provided **as-is, without warranty** of any kind. The author accepts no
|
|
|
|
| 1 |
---
|
| 2 |
base_model: google/gemma-4-12B-it-qat-q4_0-unquantized
|
| 3 |
base_model_relation: finetune
|
| 4 |
+
license: apache-2.0
|
| 5 |
library_name: transformers
|
| 6 |
pipeline_tag: image-text-to-text
|
| 7 |
tags:
|
|
|
|
| 11 |
- abliterated
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# This is a decensored version of [google/gemma-4-12B-it-qat-q4_0-unquantized](https://huggingface.co/google/gemma-4-12B-it-qat-q4_0-unquantized), made using [Heretic](https://github.com/p-e-w/heretic)
|
| 15 |
+
|
| 16 |
+
## v1.1 — thinking-mode fix
|
| 17 |
+
|
| 18 |
+
Gemma 4 is a **thinking** model: its refusal decision forms inside the
|
| 19 |
+
chain-of-thought. The first release was abliterated/evaluated with thinking
|
| 20 |
+
disabled, so it still refused once thinking was on (the default). **v1.1 is
|
| 21 |
+
re-tuned to decensor the model with thinking enabled** — the way it's actually
|
| 22 |
+
used.
|
| 23 |
|
| 24 |
## Abliteration parameters
|
| 25 |
|
| 26 |
| Parameter | Value |
|
| 27 |
| :-------- | :---: |
|
| 28 |
+
| **attn.o_proj.max_weight** | 1.48 |
|
| 29 |
+
| **attn.o_proj.max_weight_position** | 36.55 |
|
| 30 |
+
| **attn.o_proj.min_weight** | 1.29 |
|
| 31 |
+
| **attn.o_proj.min_weight_distance** | 21.18 |
|
| 32 |
+
| **mlp.down_proj.max_weight** | 1.48 |
|
| 33 |
+
| **mlp.down_proj.max_weight_position** | 31.62 |
|
| 34 |
+
| **mlp.down_proj.min_weight** | 1.43 |
|
| 35 |
+
| **mlp.down_proj.min_weight_distance** | 12.60 |
|
|
|
|
| 36 |
|
| 37 |
## Performance
|
| 38 |
|
| 39 |
+
| Metric | This model (v1.1) | Original |
|
| 40 |
| :----- | :--------: | :---------------------------: |
|
| 41 |
+
| **KL divergence** | 0.32 | 0 *(by definition)* |
|
| 42 |
+
| **Refusals, thinking on** (adversarial harmful set) | ~22% | ~99% |
|
|
|
|
| 43 |
|
| 44 |
+
KL is high relative to a typical abliteration — that is the cost of suppressing
|
| 45 |
+
refusal through the reasoning trajectory of a thinking model. The model complies
|
| 46 |
+
with the vast majority of requests in normal use; a small fraction of extreme
|
| 47 |
+
prompts may still be refused, and a stronger v2 is in progress.
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-----
|
| 50 |
|
|
|
|
| 64 |
self-moderate. Apply your own filtering, guardrails, and human review before
|
| 65 |
any production or user-facing use.
|
| 66 |
- **You are solely responsible** for how you use this model and for complying
|
| 67 |
+
with all applicable laws and with the base model's
|
| 68 |
+
[Gemma 4 license](https://ai.google.dev/gemma/docs/gemma_4_license) (Apache 2.0).
|
|
|
|
| 69 |
- **Intended for adults (18+)**, for research, evaluation, and lawful creative
|
| 70 |
use where permitted.
|
| 71 |
- Provided **as-is, without warranty** of any kind. The author accepts no
|