gghfez/amoral-gemma3-12B-vision

soob3123/amoral-gemma3-12B with the vision encoder reattached

Inference code

from transformers import AutoProcessor, Gemma3ForConditionalGeneration
from PIL import Image
import requests
import torch

model_id = "gghfez/amoral-gemma3-12B-vision"
model = Gemma3ForConditionalGeneration.from_pretrained(
    model_id, device_map="auto"
).eval()

processor = AutoProcessor.from_pretrained(model_id)

messages = [
    {
        "role": "system",
        "content": [{"type": "text", "text": "You are a helpful assistant."}]
    },
    {
        "role": "user",
        "content": [
            {"type": "image", "image": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
            {"type": "text", "text": "Describe this image in detail."}
        ]
    }
]

inputs = processor.apply_chat_template(
    messages, add_generation_prompt=True, tokenize=True,
    return_dict=True, return_tensors="pt"
).to(model.device, dtype=torch.bfloat16)

input_len = inputs["input_ids"].shape[-1]

with torch.inference_mode():
    generation = model.generate(**inputs, max_new_tokens=500, do_sample=False)
    generation = generation[0][input_len:]

decoded = processor.decode(generation, skip_special_tokens=True)
print(decoded)

Output

Here's a detailed description of the image:

Overall Impression: The image is a close-up shot of a vibrant garden scene, focusing on pink cosmos flowers and a busy bumblebee. The composition is well-balanced, with the flowers and bee as the main subjects against a backdrop of greenery and other plants.

Flowers: The primary focus is on the pink cosmos flowers. They have delicate, slightly ruffled petals in shades of pink, with a bright yellow center. Some of the flowers are in full bloom, while others appear to be past their prime, with dried or wilted petals. The flowers are clustered together, creating a sense of abundance and natural beauty.

Bumblebee: A bumblebee is prominently featured on one of the cosmos flowers. It's positioned in the center of the frame, actively collecting nectar or pollen. The bee has a fuzzy, black and yellow body, and its wings are slightly blurred due to its movement.

Background: The background consists of a mix of green foliage, including large leaves and smaller plants. There are also some dried or faded flowers in the background, adding texture and depth to the image. A few red flowers are visible in the lower right corner, providing a pop of color.

Lighting and Color: The image is well-lit, with natural light illuminating the scene. The colors are vibrant and saturated, particularly the pink of the cosmos flowers and the yellow of the bumblebee. The overall effect is one of warmth and vitality.


I tested it with other images as well, I like the results! A lot more detailed than google/gemma-3-12b-it

Downloads last month
38
Safetensors
Model size
12.2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for gghfez/amoral-gemma3-12B-vision

Finetuned
(1)
this model
Quantizations
2 models