需要自行从 Hugging Face 下载 ColPali/ColQwen2 等模型权重;仓库只提供 notebook,需自行准备 Jupyter 或 Colab 环境;微调示例的 4bit/8bit 量化依赖 bitsandbytes 等额外库
colpali-cookbooks
tonywu71MIT活跃维护ColPali 的实战教程合集,手把手教你在多模态 RAG 场景里训练、微调和改造 ColPali 视觉检索模型。
Recipes for learning, fine-tuning, and adapting ColPali to your multimodal RAG use cases. 👨🏻🍳
git clone https://github.com/tonywu71/colpali-cookbooks.git
在 Jupyter Notebook 或 IDE 中打开 examples 目录下的 .ipynbREADME 未给出具体显存要求,仅提到 RAG 示例可在 Colab 免费 T4 GPU 上运行
ColPali 系列模型的可运行 notebook 合集,覆盖推理、微调、可解释性与 RAG 全流程
ColPali 的实战教程合集,手把手教你在多模态 RAG 场景里训练、微调和改造 ColPali 视觉检索模型。
核心能力
- 用 ColPali/ColQwen2 的 transformers 原生实现做推理与打分
- 用 LoRA 微调 ColPali,可选 4bit/8bit 量化
- 生成相似度图,解释模型对页面区域的预测依据
- 用单个 VLM 加 adapter 热切换跑完整 RAG 流程以省显存
容易踩的坑
- v0.5.0v0.5.0: 🤗 transformers-native ColQwen2 cookbook最新正式版2025-06-02 · 2025-06-02 13:54 UTC
Features
Changed
- Add cookbook for using the 🤗 transformers-native implementation of ColQwen2
Fixed
- Fix GitHub notebook rendering
Full Changelog: https://github.com/tonywu71/colpali-cookbooks/compare/v0.4.0...v0.5.0
- v0.4.0v0.4.0: 🤗 transformers-native ColPali cookbook2024-12-17 · 2024-12-17 19:26 UTC
查看更新说明
Features
Changed
- Add cookbook for using the 🤗 transformers-native implementation of ColPali
Full Changelog: https://github.com/tonywu71/colpali-cookbooks/compare/v0.3.1...v0.4.0
- v0.3.12024-11-17 · 2024-11-17 22:49 UTC
查看更新说明
Features
Changed
- Change the example query in the E2E RAG cookbook with ColQwen2 and adapter hot-swapping
Full Changelog: https://github.com/tonywu71/colpali-cookbooks/compare/v0.3.0...v0.3.1
- v0.3.0v0.3.0: E2E RAG with ColQwen2 and adapter hot-swapping2024-11-17 · 2024-11-17 21:34 UTC
查看更新说明
Features
Added
- Add cookbook for E2E RAG with ColQwen2 and adapter hot-swapping
Full Changelog: https://github.com/tonywu71/colpali-cookbooks/compare/v0.2.1...v0.3.0
- v0.2.12024-11-10 · 2024-11-10 23:31 UTC
查看更新说明
Features
Changed
- Load example image from Git URL if no image path is provided in similarity map cookbooks
Fixed
- Add missing
interpretabilityoptional deps for similarity map cookbooks
Full Changelog: https://github.com/tonywu71/colpali-cookbooks/compare/v0.2.0...v0.2.1
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
ColPali Cookbooks 👨🏻🍳
[ColPali Engine] [ViDoRe Benchmark]
Introduction
ColPali is a model designed to retrieve documents by analyzing their visual features. Unlike traditional systems that rely heavily on text extraction and OCR, ColPali treats each page as an image. It uses Paligemma-3B to capture not only text, but also the layout, tables, charts, and other visual elements to create detailed multi-vector embeddings that can be used for retrieval by computing pairwise late interaction similarity scores. This offers a more comprehensive understanding of documents and enables more efficient and accurate retrieval.
This repository contains notebooks for learning about the ColVision family of models, fine-tuning them for your specific use case, creating similarity maps to interpret their predictions, and more! 😍
Table of Contents
You can find the cookbooks in the examples directory. In the table below, they are listed from most recent to oldest.
| Task | Notebook | Description |
|---|---|---|
| Inference, interpretability | Use the 🤗 transformers-native ColQwen2 | Use the 🤗 transformers-native implementation of ColQwen2 for inference, scoring, and interpretability. |
| Inference, interpretability | Use the 🤗 transformers-native ColPali | Use the 🤗 transformers-native implementation of ColPali for inference, scoring, and interpretability. |
| RAG | ColQwen2: One model for your whole RAG pipeline with adapter hot-swapping 🔥 | Save VRAM by using a unique VLM for your entire RAG pipeline. Works even on Colab's free T4 GPU! |
| Interpretability | ColQwen2: Generate your own similarity maps 👀 | Generate your own similarity maps to interpret ColQwen2's predictions. |
| Interpretability | ColPali: Generate your own similarity maps 👀 | Generate your own similarity maps to interpret ColPali's predictions. |
| Fine-tuning | Fine-tune ColPali 🛠️ | Fine-tune ColPali using LoRA and optional 4bit/8bit quantization. |
Instructions
Open with Colab
The easiest way to use the notebooks is to open them from the examples directory and click on the Colab button below:
This will open the notebook in Google Colab, where you can run the code and experiment with the models.
Run locally
If you prefer to run the notebooks locally, you can clone the repository and open the notebooks in Jupyter Notebook or in your IDE.
Citation
ColPali: Efficient Document Retrieval with Vision Language Models
Authors: Manuel Faysse*, Hugues Sibille*, Tony Wu*, Bilel Omrani, Gautier Viaud, Céline Hudelot, Pierre Colombo (* denotes equal contribution)
@misc{faysse2024colpaliefficientdocumentretrieval,
title={ColPali: Efficient Document Retrieval with Vision Language Models},
author={Manuel Faysse and Hugues Sibille and Tony Wu and Bilel Omrani and Gautier Viaud and Céline Hudelot and Pierre Colombo},
year={2024},
eprint={2407.01449},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2407.01449},
}