Instructions to use NeuML/colbert-bert-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NeuML/colbert-bert-tiny with sentence-transformers:
from sentence_transformers import MultiVectorEncoder model = MultiVectorEncoder("NeuML/colbert-bert-tiny") 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) - Inference
- Notebooks
- Google Colab
- Kaggle
Add Sentence Transformers usage
Hello!
As of Sentence Transformers v6.0.0, this checkpoint loads directly as a multi-vector (ColBERT-style late interaction) retriever through the new MultiVectorEncoder. This PR adds a usage section to the model card and the multi-vector and sentence-transformers tags. The weights and the existing usage are untouched. Given the model's stated purpose, it might be handy that this also makes it a natural unit-test checkpoint for MultiVectorEncoder pipelines.
from sentence_transformers import MultiVectorEncoder
model = MultiVectorEncoder("NeuML/colbert-bert-tiny")
query = "What is the capital of France?"
documents = [
"Paris is the capital and largest city of France.",
"Berlin is the capital of Germany.",
]
query_embeddings = model.encode_query(query)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings[0].shape)
# torch.Size([32, 128]) torch.Size([12, 128])
# MaxSim late-interaction scoring (higher is more relevant)
scores = model.similarity(query_embeddings, document_embeddings)
print(scores)
# tensor([[25.9327, 23.9168]], device='cuda:0')
Verified against a PyLate reference: the snippet reproduces exactly, and the token embeddings match with per-token cosine similarity above 0.999 and matching MaxSim scores. For reference, loaded through this integration the model scores 0.4035 mean nDCG@10 on NanoBEIR.
- Tom Aarsen
Thank you!