Views
No views yet

colpali-engine==0.3.7.openbmb/VisRAG-Ret-Train-Synthetic-data dataset.openbmb/VisRAG-Ret-Train-In-domain-data.Metric-AI/rag_docmatix_100k dataset.vidore/colpali_train_set.llamaindex/vdr-multilingual-train.alpha=128 and r=128 on the transformer layers from the language model,
as well as the final randomly initialized projection layer, and use a paged_adamw_8bit optimizer.
We train on an 4xA100 GPU setup with distributed data parallelism (via accelerate), a learning rate of 2e-4 with linear decay with 1% warmup steps, batch size per device is 128, gradient accumulation steps are 2, in bfloat16 formatcolpali-engine is installed from source or with a version superior to 0.3.1.
transformers version must be > 4.45.0.pip install git+https://github.com/illuin-tech/colpalipip install git+https://github.com/illuin-tech/colpali@colqwen2_5pip install git+https://github.com/huggingface/transformers accelerateKeyError: 'qwen2_5_vl'1import torch
2from PIL import Image
3
4from colpali_engine.models import ColQwen2_5, ColQwen2_5_Processor
5
6model = ColQwen2_5.from_pretrained(
7 "Metric-AI/ColQwen2.5-3b-multilingual-v1.0",
8 torch_dtype=torch.bfloat16,
9 device_map="cuda:0", # or "mps" if on Apple Silicon
10 ).eval()
11processor = ColQwen2_5_Processor.from_pretrained("Metric-AI/ColQwen2.5-3b-multilingual-v1.0")
12
13# Your inputs
14images = [
15 Image.new("RGB", (32, 32), color="white"),
16 Image.new("RGB", (16, 16), color="black"),
17]
18queries = [
19 "Is attention really all you need?",
20 "What is the amount of bananas farmed in Salvador?",
21]
22
23# Process the inputs
24batch_images = processor.process_images(images).to(model.device)
25batch_queries = processor.process_queries(queries).to(model.device)
26
27# Forward pass
28with torch.no_grad():
29 image_embeddings = model(**batch_images)
30 query_embeddings = model(**batch_queries)
31
32scores = processor.score_multi_vector(query_embeddings, image_embeddings)1@misc{faysse2024colpaliefficientdocumentretrieval,
2 title={ColPali: Efficient Document Retrieval with Vision Language Models},
3 author={Manuel Faysse and Hugues Sibille and Tony Wu and Bilel Omrani and Gautier Viaud and Céline Hudelot and Pierre Colombo},
4 year={2024},
5 eprint={2407.01449},
6 archivePrefix={arXiv},
7 primaryClass={cs.IR},
8 url={https://arxiv.org/abs/2407.01449},
9}