Instructions to use codeShare/gemma-4-E2B-it-heretic-image-caption-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use codeShare/gemma-4-E2B-it-heretic-image-caption-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("coder3101/gemma-4-E2B-it-heretic") model = PeftModel.from_pretrained(base_model, "codeShare/gemma-4-E2B-it-heretic-image-caption-adapter") - Transformers
How to use codeShare/gemma-4-E2B-it-heretic-image-caption-adapter with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="codeShare/gemma-4-E2B-it-heretic-image-caption-adapter")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("codeShare/gemma-4-E2B-it-heretic-image-caption-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Gemma 4 E2B Uncensored Image Caption Adapter
A multimodal LoRA adapter fine-tuned for image understanding and image caption generation.
Description
This is an early version trained on approximately 3,000 AI-generated images and prompts for models such as Chroma, Krea 2 and Moss Image.
The adapter is designed to improve the image captioning capabilities of an abliterated Gemma 4 E2B model, particularly for describing AI-generated imagery.
The underlying model has had its refusal behavior modified through abliteration. This adapter aims to improve its image-description capabilities.
Model information
| Property | Value |
|---|---|
| Base model | coder3101/gemma-4-E2B-it-heretic |
| Architecture | PEFT LoRA |
| Format | Safetensors |
| Task | Image captioning |
| Processor | Included |
Installation
pip install torch transformers peft accelerate safetensors pillow
Loading the adapter
import torch
from transformers import AutoProcessor, AutoModelForMultimodalLM
from peft import PeftModel
BASE_MODEL = "coder3101/gemma-4-E2B-it-heretic"
ADAPTER = "codeShare/gemma-4-E2B-it-heretic-image-caption-adapter"
processor = AutoProcessor.from_pretrained(ADAPTER)
base_model = AutoModelForMultimodalLM.from_pretrained(
BASE_MODEL,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER,
)
model.eval()
Usage
Use the included processor and the conversation format supported by the base model.
This repository contains a standard PEFT LoRA adapter, not a merged standalone model.
Training
Multimodal QLoRA fine-tuning.
The original training dataset and private training artifacts are not included.
License
Please refer to the base model's license and usage restrictions.
- Downloads last month
- 74
Model tree for codeShare/gemma-4-E2B-it-heretic-image-caption-adapter
Base model
google/gemma-4-E2B