Text Ranking
Transformers
Safetensors
multilingual
t5gemma2
text2text-generation
reranker
encoder-decoder
FBNL
Retrieval
RAG
Instructions to use KaLM-Embedding/KaLM-Reranker-V1-Nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KaLM-Embedding/KaLM-Reranker-V1-Nano with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("KaLM-Embedding/KaLM-Reranker-V1-Nano") model = AutoModelForMultimodalLM.from_pretrained("KaLM-Embedding/KaLM-Reranker-V1-Nano") - Notebooks
- Google Colab
- Kaggle
| 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-Nano", | |
| 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)) | |