Downloads · 30 days
10
17% of all-time downloads
clevrpwn/danger-gemma-e4b
danger-gemma-e4b is a text generation model from clevrpwn. Use it when you need the model to write or continue text. It is set up for peft.
This model is a fine-tuned version of unsloth/gemma-4-e4b-it (Gemma 4 E4B IT), refined through an iterative autotraining loop to maximize performance in complex reasoning and instruction following. It utilizes the Uns…
Downloads · 30 days
10
17% of all-time downloads
All-time downloads
59
Public
Repo size
372 MB
Likes
0
Public
Click a slice to open those files.
.safetensors339 MB · 91%
From the Hugging Face model README
This model is a fine-tuned version of unsloth/gemma-4-e4b-it (Gemma 4 E4B IT), refined through an iterative autotraining loop to maximize performance in complex reasoning and instruction following. It utilizes the Unsloth framework for efficient 4-bit fine-tuning and is optimized for agentic tool use and mathematical reasoning.
Evaluated against the base gemma-4-e4b-it using a 1-sample snapshot across key benchmarks (local inference with Qwen 3.5 judge):
| Benchmark | Base Model (Snapshot) | danger-gemma-e4b | Delta |
|---|---|---|---|
| Arena AI (Text) | 1015 | 1160 | +14.3% |
| Math (Proxy) | 100.0%* | 100.0%* | - |
| Code (Proxy) | 100.0%* | 100.0%* | - |
*Note: High success on small sample math/code tasks suggests strong core capability in both. In larger samples (n=5), the fine-tune consistently maintained 90%+ in Math reasoning.
The model demonstrates a strong "thinking" behavior, often providing detailed step-by-step breakdowns before arriving at a final answer. While this improves accuracy, it may require specific extraction logic for MCQ tasks that expect only a single token.
The model underwent an automated fine-tuning loop with the following trajectory:
Note: The following is a reference to the base model's capabilities and intended use.
Gemma 4 is the next generation of open models from Google. Gemma 4 models are built from the same research and technology used to create the Gemini models.
Model type: Text-to-text, Decoder-only Language(s): English License: Gemma Terms of Use
from unsloth import FastLanguageModel
from transformers import TextStreamer
import torch
# 1. Load the base model and tokenizer
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/gemma-4-e4b-it", # Base model
max_seq_length = 4096,
dtype = None,
load_in_4bit = True,
)
# 2. Load the LoRA adapter
model = FastLanguageModel.get_peft_model(
model,
r = 32,
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",],
lora_alpha = 64,
lora_dropout = 0,
bias = "none",
use_gradient_checkpointing = "unsloth",
random_state = 3407,
use_rslora = False,
loftq_config = None,
)
model.load_adapter("clevrpwn/danger-gemma-e4b") # Load the fine-tuned weights
# Enable fast inference
FastLanguageModel.for_inference(model)
# Prepare the prompt
messages = [
{"role": "user", "content": [{"type": "text", "text": "Explain the concept of quantum entanglement."}]}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text=[prompt], return_tensors="pt").to("cuda")
# Recommended: Use streamer for better interactive feel
streamer = TextStreamer(tokenizer, skip_prompt=True)
_ = model.generate(**inputs, max_new_tokens=512, streamer=streamer, use_cache=True)