Zen3 Reranker Medium
Medium-sized Zen3 reranker for higher accuracy re-scoring in RAG pipelines.
Overview
Built on Zen MoDE (Mixture of Distilled Experts) architecture with 1.5B parameters and 8K context window.
Developed by Hanzo AI and the Zoo Labs Foundation.
Quick Start
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
model_id = "zenlm/zen3-reranker-medium"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id, torch_dtype="auto")
query = "What is machine learning?"
passages = [
"Machine learning is a subset of artificial intelligence...",
"The weather today is sunny and warm.",
"Neural networks learn from labeled training data.",
]
pairs = [[query, p] for p in passages]
features = tokenizer(pairs, padding=True, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
scores = model(**features).logits.squeeze(-1)
ranked = sorted(zip(scores.tolist(), passages), reverse=True)
for score, passage in ranked:
print(f"Score: {score:.4f} | {passage[:80]}")
Model Details
| Attribute | Value |
|---|---|
| Parameters | 1.5B |
| Architecture | Zen MoDE |
| Context | 8K tokens |
| License | Apache 2.0 |
License
Apache 2.0
- Downloads last month
- 38