Using a slow image processor as `use_fast` is unset - Transformers issue
#45
by
do-me
- opened
Running on Linux, CPU-only, python 3.13., I get this error when running with transformers.
Apparently the transformers code is using a slow image processor. How to use the fast one?
Using a slow image processor as
use_fast
is unset and a slow processor was saved with this model.use_fast=True
will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor withuse_fast=False
.
# !pip install transformers einops timm pillow
from transformers import AutoModel
# Initialize the model
model = AutoModel.from_pretrained('jinaai/jina-clip-v2', trust_remote_code=True)
# Choose a matryoshka dimension, set to None to get the full 1024-dim vectors
truncate_dim = 512
all_images = ['https://i.ibb.co/nQNGqL0/beach1.jpg', 'https://i.ibb.co/r5w8hG8/beach2.jpg']
image_embeddings = model.encode_image(
all_images[:2], truncate_dim=truncate_dim
)