Run this model with HF Jobs

Run bRadu/gemma-4-E2B-it-textonly on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/bRadu/gemma-4-E2B-it-textonly. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/bRadu/gemma-4-E2B-it-textonly on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/bRadu/gemma-4-E2B-it-textonly. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/bRadu/gemma-4-E2B-it-textonly. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Configuration Parsing Warning:In config.json: "num_experts" must be a number

Gemma 4 E2B-it (Text-Only)

Text-only version of google/gemma-4-E2B-it with the vision and audio encoders removed.

Why?

The original Gemma 4 E2B is a multimodal model (text + vision + audio). When fine-tuning for text-only tasks, the multimodal architecture causes:

  • Higher training loss due to the multimodal overhead
  • Requires mm_token_type_ids tensors even for text-only inputs
  • Batch size > 1 crashes during training
  • Extra ~450M parameters (vision + audio encoders) that serve no purpose for text tasks

This model extracts just the language model (Gemma4ForCausalLM) and the text tokenizer, making it suitable for standard text-only SFT/DPO/KTO fine-tuning.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("bRadu/gemma-4-E2B-it-textonly", torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("bRadu/gemma-4-E2B-it-textonly")

messages = [
    {"role": "user", "content": "Hello!"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True, tokenize=True, return_dict=True).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Downloads last month
48
Safetensors
Model size
5B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for bRadu/gemma-4-E2B-it-textonly

Finetuned
(554)
this model
Adapters
1 model
Finetunes
1 model