Run this model with HF Jobs

Run topk-io/Iso-ModernColBERT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/topk-io/Iso-ModernColBERT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/topk-io/Iso-ModernColBERT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Add Sentence Transformers usage

#1
by tomaarsen HF Staff - opened

Hello!

Starting with the next Sentence Transformers release (v6.0.0, planned for around the 18th), this checkpoint loads directly as a multi-vector (ColBERT-style late interaction) retriever through the new MultiVectorEncoder, alongside its existing PyLate usage. This PR adds a Sentence Transformers usage section to the model card and a multi-vector tag. The weights and the existing PyLate usage are untouched.

I'd love to feature this model in that release's blog post and documentation, especially once it loads without the revision pin (that is, once this PR is merged).

pip install "sentence-transformers @ git+https://github.com/huggingface/sentence-transformers.git"
from sentence_transformers import MultiVectorEncoder

model = MultiVectorEncoder("topk-io/Iso-ModernColBERT", revision="refs/pr/1")

query = "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.",
    "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
]

query_embeddings = model.encode_query(query)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings[0].shape)
# (12, 128) (18, 128)

# MaxSim late-interaction scoring (higher is more relevant)
scores = model.similarity(query_embeddings, document_embeddings)
print(scores)
# tensor([[ 9.4844, 10.4180,  9.8516, 10.1953]])
  • Tom Aarsen
tomaarsen changed pull request status to open
marekgalovic changed pull request status to merged
TopK org

Thanks @tomaarsen for the PR and for the mention! 🫶

Gladly! If all goes well, the release, blogpost, and documentation etc. should be live later today!

  • Tom Aarsen

The release and its blogpost are now live! https://huggingface.co/blog/multi-vector-encoder

  • Tom Aarsen

Sign up or log in to comment