Views
No views yet

BiModernVBERT the dense encoder version of ModernVBERT that is fine-tuned for visual document retrieval tasks.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).1git clone https://github.com/illuin-tech/colpali.git
2cd colpali
3git checkout vbert
4pip install -e .1import torch
2from colpali_engine.models import BiModernVBert, BiModernVBertProcessor
3from PIL import Image
4from huggingface_hub import hf_hub_download
5
6model_id = "ModernVBERT/bimodernvbert"
7
8processor = BiModernVBertProcessor.from_pretrained(model_id)
9model = BiModernVBert.from_pretrained(
10 model_id,
11 torch_dtype=torch.float32,
12 trust_remote_code=True
13)
14
15image = Image.open(hf_hub_download("HuggingFaceTB/SmolVLM", "example_images/rococo.jpg", repo_type="space"))
16text = "This is a text"
17
18# Prepare inputs
19text_inputs = processor.process_texts([text])
20image_inputs = processor.process_images([image])
21
22# Inference
23q_embeddings = model(**text_inputs)
24corpus_embeddings = model(**image_inputs)
25
26# Get the similarity scores
27scores = processor.score(q_embeddings, corpus_embeddings)
28
29print("Similarity scores:", scores)
@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},
}