玩模型开放模型 · 清晰来源 · 自主选择
返回模型目录
smashingtags /

gemma-4-12b-it-abliterated-nf4

HF 源站

smashingtags/gemma-4-12b-it-abliterated-nf4 is an uncensored open-source model hosted on Hugging Face.

Image-Text-to-TextsafetensorsLicense: gemma12Bgemma4_unifiedabliterateduncensoredgemma-4multimodal4-bitbitsandbytesnf4conversational
README.md说明 / 使用方法

base_model: google/gemma-4-12B-it-qat-q4_0-unquantized license: gemma pipeline_tag: image-text-to-text tags: [abliterated, uncensored, gemma-4, multimodal, 4-bit, bitsandbytes, nf4]

gemma-4-12b-it-abliterated-nf4

Abliterated (refusal-direction removed) Gemma 4 12B, quantized to int4 (NF4). ~7.7 GB, fits a 16 GB GPU, retains text + image + audio. Built from Google's official QAT weights (google/gemma-4-12B-it-qat-q4_0-unquantized), so int4 quality is near-bf16. Personal/research use.

Requirements

  • NVIDIA GPU, 16 GB+ VRAM — NF4/bitsandbytes is CUDA-only. (On an Intel Arc / non-NVIDIA card this will NOT load; use the GGUF build or ask for a Vulkan-compatible quant.)
  • pip install "transformers>=5.12" bitsandbytes accelerate huggingface_hub

Text chat

from transformers import AutoModelForImageTextToText, AutoProcessor
import torch
m = AutoModelForImageTextToText.from_pretrained(
    "smashingtags/gemma-4-12b-it-abliterated-nf4", device_map="cuda", torch_dtype=torch.bfloat16)
p = AutoProcessor.from_pretrained("smashingtags/gemma-4-12b-it-abliterated-nf4")
msgs = [{"role":"user","content":[{"type":"text","text":"Explain how a lock pick works."}]}]
inp = p.apply_chat_template(msgs, add_generation_prompt=True, tokenize=True,
                            return_dict=True, return_tensors="pt").to("cuda")
out = m.generate(**inp, max_new_tokens=300)
print(p.decode(out[0][inp["input_ids"].shape[1]:], skip_special_tokens=True))

With an image (vision)

msgs = [{"role":"user","content":[
    {"type":"image","url":"https://.../photo.jpg"},
    {"type":"text","text":"What's in this image?"}]}]
# same apply_chat_template + generate as above

Serve as an API (vLLM, OpenAI-compatible)

vllm serve smashingtags/gemma-4-12b-it-abliterated-nf4 --quantization bitsandbytes \
  --max-model-len 8192 --port 8000
# then POST to http://localhost:8000/v1/chat/completions (text or image_url content)

Related builds

repoformatsizeruntimemodalities
gemma-4-12b-it-abliterated-nf4 (this)int4 NF47.7 GBtransformers / vLLM (CUDA)text + image + audio
gemma-4-12b-it-abliteratedbf1624 GBtransformers / vLLMtext + image + audio
gemma-4-12b-it-abliterated-GGUFq4_0 GGUF7 GBOllama / llama.cpptext only

Abliteration: difference-of-means refusal direction (Arditi et al.), hook-captured, orthogonalized out of the text decoder's o_proj+mlp.down_proj (top 70% layers); vision/audio encoders and tied embeddings untouched. Refusal smoke: base 3/3 → 0/3.

HUGGING FACE

上游数据

HF 下载量11
HF 点赞量0

HF 下载量为源站最近 30 天统计,与本站点击分开。

SITE STATS

本站统计

下载点击—
请求数—
匿名去重—最近 7 天—

本站下载量记录按钮点击,不代表下载完成;短时连点会去重。

来源与版本

作者
smashingtags
最近更新
2026/06/14
最新创建
2026/06/14
HF 趋势
未知
数据快照
2026/09/17
版本
未知
许可证
gemma