when i download the checkpoint locally the code fails to run

#8
by GrandeSheng - opened

import torch
from PIL import Image
from transformers.utils.import_utils import is_flash_attn_2_available

from colpali_engine.models import ColQwen2_5, ColQwen2_5_Processor

model = ColQwen2_5.from_pretrained(
pretrained_model_name_or_path="models/colqwen2_5",
torch_dtype=torch.bfloat16,
device_map="cuda:0", # or "mps" if on Apple Silicon
attn_implementation="flash_attention_2" if is_flash_attn_2_available() else None,
).eval()
processor = ColQwen2_5_Processor.from_pretrained("models/colqwen2_5")

GrandeSheng changed discussion status to closed

Sign up or log in to comment