Downloads · 30 days
0
0% of all-time downloads
cosmo3769/finetuned_paligemma_vqav2_small
finetuned_paligemma_vqav2_small is a machine learning model from cosmo3769. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as gemma.
This model is a fine-tuned version of google/paligemma-3b-pt-224 using the QLoRA technique on a small chunk of vqav2 dataset by Merve.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
37
Public
Parameters
11.3M
136 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors90.5 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of google/paligemma-3b-pt-224 using the QLoRA technique on a small chunk of vqav2 dataset by Merve.
import torch
import requests
from PIL import Image
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
pretrained_model_id = "google/paligemma-3b-pt-224"
finetuned_model_id = "pyimagesearch/finetuned_paligemma_vqav2_small"
processor = AutoProcessor.from_pretrained(pretrained_model_id)
finetuned_model = PaliGemmaForConditionalGeneration.from_pretrained(finetuned_model_id)
prompt = "What is behind the cat?"
image_file = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cat.png?download=true"
raw_image = Image.open(requests.get(image_file, stream=True).raw)
inputs = processor(raw_image.convert("RGB"), prompt, return_tensors="pt")
output = finetuned_model.generate(**inputs, max_new_tokens=20)
print(processor.decode(output[0], skip_special_tokens=True)[len(prompt):])
# gramophone
The following hyperparameters were used during training:
