Text Ranking
sentence-transformers
Safetensors
Transformers
multilingual
t5gemma2
text2text-generation
reranker
encoder-decoder
FBNL
matryoshka
retrieval
RAG

Run this model with HF Jobs

Run KaLM-Embedding/KaLM-Reranker-V1-Large-R2 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/KaLM-Embedding/KaLM-Reranker-V1-Large-R2. 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/KaLM-Embedding/KaLM-Reranker-V1-Large-R2 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.
File size: 491 Bytes
03ea0fd
 
 
 
 
 
 
 
 
 
50f673f
03ea0fd
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from kalm_t5gemma2_vllm_plugin import KaLMVLLMReranker


query = "What is the capital of China?"
documents = [
    "The capital of China is Beijing.",
    "Gravity attracts bodies toward one another.",
]

with KaLMVLLMReranker(
    "KaLM-Embedding/KaLM-Reranker-V1-Large-R2",
    encoder_chunk_size=4,
    query_max_length=512,
    document_max_length=1024,
) as reranker:
    print(reranker.predict([(query, document) for document in documents]))
    print(reranker.rank(query, documents))