How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("image-text-to-text", model="hf-internal-testing/tiny-random-paligemma-lora-key-mapping")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM

processor = AutoProcessor.from_pretrained("hf-internal-testing/tiny-random-paligemma-lora-key-mapping")
model = AutoModelForMultimodalLM.from_pretrained("hf-internal-testing/tiny-random-paligemma-lora-key-mapping", device_map="auto")
Quick Links

hf-internal-testing/tiny-random-paligemma-lora-key-mapping

Tiny-random PaliGemma checkpoint bundling a LoRA adapter that requires a key_mapping to load onto the underlying PaliGemmaModel.

It mirrors vidore/colpali at tiny scale: the adapter's text weights are stored under the old language_model.model.layers.* layout, so loading them onto today's PaliGemmaModel (language_model.layers.*) needs:

from transformers import PaliGemmaModel

model = PaliGemmaModel.from_pretrained(
    "hf-internal-testing/tiny-random-paligemma-lora-key-mapping",
    key_mapping={r"language_model\.model\.": "language_model."},
)

PaliGemmaForConditionalGeneration auto-bridges this (via the llava conversion) and does not need the mapping; the bare PaliGemmaModel does. Every lora_A weight is filled with 0.0234 and every lora_B weight with 0.0567, so a test can assert the adapter was restored from the checkpoint.

Downloads last month
3,355
Safetensors
Model size
40k params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support