Downloads · 30 days
149
7% of all-time downloads
paultltc/colmodernvbert_hf
colmodernvbert_hf is a visual document retrieval model from paultltc. Use it for the visual document retrieval task on the model card, and read the license before you ship it in a product. It is set up for colpali. The card lists the license as mit.
<div <img src="bg.png" width="100%" alt="ModernVBERT" / </div
Downloads · 30 days
149
7% of all-time downloads
All-time downloads
2.1K
Public
Repo size
28 MB
Likes
0
Public
Click a slice to open those files.
.safetensors27.2 MB · 86%
From the Hugging Face model README
This is the model card for ColModernVBERT, the late-interaction version of ModernVBERT that is fine-tuned for visual document retrieval tasks, our most performant model on this task.
The ModernVBERT suite is a suite of compact 250M-parameter vision-language encoders, achieving state-of-the-art performance in this size class, matching the performance of models up to 10x larger.
For more information about ModernVBERT, please check the arXiv preprint.
ColModernVBERT is the late-interaction version that is fine-tuned for visual document retrieval tasks, our most performant model on this task.BiModernVBERT is the bi-encoder version that is fine-tuned for visual document retrieval tasks.ModernVBERT-embed is the bi-encoder version after modality alignment (using a MLM objective) and contrastive learning, without document specialization.ModernVBERT is the base model after modality alignment (using a MLM objective).🏎️ If your GPU supports it, we recommend using ModernVBERT with Flash Attention 2 to achieve the highest GPU throughput. To do so, install Flash Attention 2 as follows, then use the model as normal:
For now, the branch for using colmdernvbert is not yet merged in the official colpali repo, you need to clone the repo and checkout on the right branch to use it.
git clone https://github.com/illuin-tech/colpali.git
cd colpali
git checkout vbert
pip install -e .
Here is an example of masked token prediction using ModernVBERT:
import torch
from colpali_engine.models import ColModernVBert, ColModernVBertProcessor
from PIL import Image
from huggingface_hub import hf_hub_download
model_id = "ModernVBERT/colmodernvbert"
processor = ColModernVBertProcessor.from_pretrained(model_id)
model = ColModernVBert.from_pretrained(
model_id,
torch_dtype=torch.float32,
trust_remote_code=True
)
image = Image.open(hf_hub_download("HuggingFaceTB/SmolVLM", "example_images/rococo.jpg", repo_type="space"))
text = "This is a text"
# Prepare inputs
text_inputs = processor.process_texts([text])
image_inputs = processor.process_images([image])
# Inference
q_embeddings = model(**text_inputs)
corpus_embeddings = model(**image_inputs)
# Get the similarity scores
scores = processor.score(q_embeddings, corpus_embeddings)
print("Similarity scores:", scores)
We release the ModernVBERT model architectures, model weights, and training codebase under the MIT license.
If you use ModernVBERT in your work, please cite:
@misc{teiletche2025modernvbertsmallervisualdocument,
title={ModernVBERT: Towards Smaller Visual Document Retrievers},
author={Paul Teiletche and Quentin Macé and Max Conti and Antonio Loison and Gautier Viaud and Pierre Colombo and Manuel Faysse},
year={2025},
eprint={2510.01149},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2510.01149},
}