illuin-tech / colpali

The code used to train and run inference with the ColPali architecture.
https://huggingface.co/vidore
MIT License
851 stars 75 forks source link

Hugging Face Model Card Inference Code not working after recent refactor #55

Closed DrChrisLevy closed 1 month ago

DrChrisLevy commented 1 month ago

I think related to the recent release https://github.com/illuin-tech/colpali/releases/tag/v0.3.0

Im using this Model Card https://huggingface.co/vidore/colpali-v1.2

from colpali_engine.models.paligemma_colbert_architecture import ColPali
from colpali_engine.trainer.retrieval_evaluator import CustomEvaluator
from colpali_engine.utils.colpali_processing_utils import process_images, process_queries
from colpali_engine.utils.image_from_page_utils import load_from_dataset

For example:

Screenshot 2024-09-11 at 9 30 51 AM
DrChrisLevy commented 1 month ago

I'll just start with your updated inference code for now here and try that. Might just be confusing for users who go to transformers model card and try to run the "old" inference code.

Or maybe I will start with the newer inference example in your README. What's the different between the REAMDE quick start example code and the inference code in the repo ?

ManuelFay commented 1 month ago

Hey ! Yeah the model card works with 0.2.0 but it's confusing I agree, I'll see to update it.

The inference code given has a collator for batching and working with many images, the quick start just shows how to do a forward pass, up to you to batch it how you like !

DrChrisLevy commented 1 month ago

thanks for the quick reply! Very helpful. I just found you on Twitter too so I can follow your work!