Downloads · 30 days
5
5% of all-time downloads
rivitti/paligemma2-10b-mix-224-int8
paligemma2-10b-mix-224-int8 is a image-text-to-text model from rivitti. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as gemma.
INT8-ready release of PaliGemma2 10B for NVIDIA GPU inference with Transformers + BitsAndBytes.
Downloads · 30 days
5
5% of all-time downloads
All-time downloads
105
Public
Parameters
9.7B
10.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors10.6 GB · 100%
How the weights are stored.
I88.7B · 90%
From the Hugging Face model README
INT8-ready release of PaliGemma2 10B for NVIDIA GPU inference with Transformers + BitsAndBytes.
This repository is intended to be loaded with 8-bit quantization at inference time.
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration, BitsAndBytesConfig from PIL import Image import torch
repo_id = "rivitti/paligemma2-10b-mix-224-int8"
processor = AutoProcessor.from_pretrained(repo_id) model = PaliGemmaForConditionalGeneration.from_pretrained( repo_id, quantization_config=BitsAndBytesConfig(load_in_8bit=True), device_map="cuda:0", torch_dtype=torch.float16, )
image = Image.open("your_image.jpg").convert("RGB") prompt = "<image> Answer briefly: What is in this image?"
inputs = processor(text=prompt, images=image, return_tensors="pt") inputs = {k: v.to("cuda:0") for k, v in inputs.items()}
with torch.no_grad(): output = model.generate(**inputs, max_new_tokens=32, do_sample=False)
text = processor.batch_decode(output[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0] print(text.strip())