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 SentenceTransformer model = SentenceTransformer("vidore/colpali") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
| {%- for message in messages -%} | |
| {%- set images = message['content'] | selectattr('type', 'equalto', 'image') | list -%} | |
| {%- set texts = message['content'] | selectattr('type', 'equalto', 'text') | map(attribute='text') | list -%} | |
| {%- if images -%} | |
| {%- for _ in images -%}{{- '<image>' -}}{%- endfor -%} | |
| {{- texts[0] if texts else 'Describe the image.' -}} | |
| {%- else -%} | |
| {{ bos_token }}Question: {{ texts[0] }}{{ '<unused0>' * 5 }} | |
| {% endif %} | |
| {% endfor %} | |