Views
No views yet

gemma-3-27b-it-abliterated-FP8 is an FP8-Dynamic compressed variant of Maxime Labonne’s gemma-3-27b-it-abliterated model. This version applies FP8 dynamic quantization while preserving the layerwise abliteration technique that minimizes refusal behavior across Gemma 3’s deep architecture. The result is a highly capable 27B instruction-tuned model with improved hardware efficiency and reduced memory footprint.
down_proj, o_proj, and feedforward components1from transformers import AutoProcessor, Gemma3ForConditionalGeneration
2from PIL import Image
3import requests
4import torch
5
6model_id = "prithivMLmods/gemma-3-27b-it-abliterated-FP8"
7
8model = Gemma3ForConditionalGeneration.from_pretrained(
9 model_id, device_map="auto"
10).eval()
11
12processor = AutoProcessor.from_pretrained(model_id)
13
14messages = [
15 {
16 "role": "system",
17 "content": [{"type": "text", "text": "You are a helpful assistant."}]
18 },
19 {
20 "role": "user",
21 "content": [
22 {"type": "image", "image": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
23 {"type": "text", "text": "Describe this image in detail."}
24 ]
25 }
26]
27
28inputs = processor.apply_chat_template(
29 messages, add_generation_prompt=True, tokenize=True,
30 return_dict=True, return_tensors="pt"
31).to(model.device, dtype=torch.bfloat16)
32
33input_len = inputs["input_ids"].shape[-1]
34
35with torch.inference_mode():
36 generation = model.generate(**inputs, max_new_tokens=100, do_sample=False)
37 generation = generation[0][input_len:]
38
39decoded = processor.decode(generation, skip_special_tokens=True)
40print(decoded)Critical Note: This model minimizes built-in refusal mechanisms.