Downloads · 30 days
58
29% of all-time downloads
vllm-sr/mmbert32k-factcheck-classifier-lora
mmbert32k-factcheck-classifier-lora is a text classification model from vllm-sr. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as apache-2.0.
Part of the MoM (Mixture of Models) family for vLLM Semantic Router.
Downloads · 30 days
58
29% of all-time downloads
All-time downloads
202
Public
Repo size
116 MB
Likes
1
Public
Click a slice to open those files.
.json34.4 MB · 72%
From the Hugging Face model README
Part of the MoM (Mixture of Models) family for vLLM Semantic Router.
This adapter is fine-tuned on vllm-sr/mmbert-32k-yarn to decide whether a user query should be routed to a fact-checking or factual-verification path.
| Label | ID | Meaning | Example |
|---|---|---|---|
| NO_FACT_CHECK_NEEDED | 0 | Creative, opinion, brainstorming, or other prompts that do not require factual verification | "Write me a poem about the ocean." |
| FACT_CHECK_NEEDED | 1 | Factual questions or claims that should be verified against external knowledge | "What is the capital of France?" |
from peft import PeftModel
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
base_model = "vllm-sr/mmbert-32k-yarn"
adapter = "vllm-sr/mmbert32k-factcheck-classifier-lora"
tokenizer = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForSequenceClassification.from_pretrained(
base_model,
num_labels=2,
)
model = PeftModel.from_pretrained(model, adapter)
model.eval()
id2label = {
0: "NO_FACT_CHECK_NEEDED",
1: "FACT_CHECK_NEEDED",
}
queries = [
"What is the capital of France?",
"Write me a poem about the ocean.",
]
for query in queries:
inputs = tokenizer(
query,
return_tensors="pt",
truncation=True,
max_length=32768,
)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)[0]
pred = torch.argmax(probs).item()
print(
{
"text": query,
"label": id2label[pred],
"score": float(probs[pred]),
}
)
If you do not want a PEFT dependency at inference time, use the merged checkpoint:
from transformers import pipeline
pipe = pipeline(
"text-classification",
model="vllm-sr/mmbert32k-factcheck-classifier-merged",
)
print(pipe("Who is the current president of France?"))
vllm-sr/mmbert-32k-yarn0 -> NO_FACT_CHECK_NEEDED1 -> FACT_CHECK_NEEDEDThe base model is multilingual, but the supervised training mixture for this adapter is primarily composed of public English-language question-answering and instruction datasets. Validate carefully on your target languages before using it as a hard routing gate.
The published adapter is documented as a balanced 8,500-example training mixture with:
In the repository training pipeline, the best checkpoint is selected by validation F1, and the reported evaluation metrics are:
The current model card for the published adapter describes the following source mixture.
The repository training code also supports broader mixtures for local retraining, including NISQ-style information-seeking labels and additional fact-check-oriented corpora. If you plan to reproduce or extend this model, use the repository training script and inspect the dataset-loading logic directly.
This model is intended for query-level routing, such as:
vllm-sr/mmbert32k-factcheck-classifier-mergedvllm-sr/mmbert-32k-yarnvllm-sr/mom-multilingual-classApache 2.0