Visual Document Retrieval
ColPali
Safetensors
sentence-transformers
English
vidore
vidore-experimental
multi-vector
Instructions to use vidore/colpali-v1.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ColPali
How to use vidore/colpali-v1.2 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-v1.2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("vidore/colpali-v1.2") 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
Remove convert_to_tensor=True in MultiVectorEncoder, this parameter was removed
Browse filesHello!
This simple PR removes `convert_to_tensor=True` in the MultiVectorEncoder `encode_query`/`encode_document`/`encode` calls, as I removed this parameter and made a Tensor output the default just prior to the release. I didn't realize these snippets still used this parameter, my apologies!
- Tom Aarsen
README.md
CHANGED
|
@@ -83,8 +83,8 @@ images = [
|
|
| 83 |
"https://huggingface.co/datasets/sentence-transformers/example-documents/resolve/main/doc4.jpg",
|
| 84 |
]
|
| 85 |
|
| 86 |
-
query_embeddings = model.encode_query(queries
|
| 87 |
-
document_embeddings = model.encode_document(images
|
| 88 |
print(f"Query 0 shape: {tuple(query_embeddings[0].shape)}")
|
| 89 |
print(f"Document 0 shape: {tuple(document_embeddings[0].shape)}")
|
| 90 |
# Query 0 shape: (23, 128)
|
|
|
|
| 83 |
"https://huggingface.co/datasets/sentence-transformers/example-documents/resolve/main/doc4.jpg",
|
| 84 |
]
|
| 85 |
|
| 86 |
+
query_embeddings = model.encode_query(queries)
|
| 87 |
+
document_embeddings = model.encode_document(images)
|
| 88 |
print(f"Query 0 shape: {tuple(query_embeddings[0].shape)}")
|
| 89 |
print(f"Document 0 shape: {tuple(document_embeddings[0].shape)}")
|
| 90 |
# Query 0 shape: (23, 128)
|