Instructions to use vidore/colpali with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ColPali
How to use vidore/colpali with ColPali:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- sentence-transformers
How to use vidore/colpali with sentence-transformers:
from sentence_transformers import MultiVectorEncoder model = MultiVectorEncoder("vidore/colpali") queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
Model resources usage
Hello, I tried to run this model on T4 and A10 GPUs and ran into datatypes and memory problems.
Is it only possible to run it on high-end GPU or I am doing something wrong?
Should not be that memory constraining, it runs on MacBooks or on local small GPUs. Are you loading it in bf16 ? Did you play with the batch size during indexing ?
Very weird... It OOMs on GPU ? Can queries be indexed ?
Wrong account on the phone :),
Yes. I run it successfully but slowly on my Mac so I switched to A10 on g5.xlarge on AWS and limited the batch size to 1 and the program gets killed after images are processed and the model part starts. I used bf16 as in the repo example
Sorry for the mistake but I went through my pipeline once again and I realised that it is infact processing images from one long pdf which crashes because I was iterating over files, not pdf pages. Then the model works without OOM. By bad :(