Downloads · 30 days
416
35% of all-time downloads
temsa/mmarco-mMiniLMv2-L12-H384-v1-onnx-cpu-qint8
mmarco-mMiniLMv2-L12-H384-v1-onnx-cpu-qint8 is a text ranking model from temsa. Use it for the text ranking task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as apache-2.0.
This repo publishes a plain ONNX Runtime dynamic-int8 quantization of cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 for CPU reranking.
Downloads · 30 days
416
35% of all-time downloads
All-time downloads
1.2K
Public
Repo size
429 MB
Likes
0
Public
Click a slice to open those files.
.onnx407 MB · 95%
From the Hugging Face model README
mmarco-mMiniLMv2-L12-H384-v1 ONNX CPU Dynamic INT8This repo publishes a plain ONNX Runtime dynamic-int8 quantization of cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 for CPU reranking.
It is intended as an easy-to-download multilingual reranker artifact for English and Irish-language search workloads.
cross-encoder/mmarco-mMiniLMv2-L12-H384-v1qint8MatMul, Gemm, Attentionmodel.onnxThis is a derivative artifact of the upstream Apache-2.0 model. Please review the upstream model card for training/background details:
Measured on a bilingual public proxy reranking suite used for Irish/English screening:
200 queries total100 English + 100 Irish20 candidates per querybatch_size=64max_length=256threads=32Quality:
MRR@10: 0.97125MRR@10: 0.9475MRR@10: 0.9950Runtime on 100 queries:
p50 query latency: 168.9 msp95 query latency: 215.8 msp99 query latency: 244.3 msImportant caveat:
gov.ie relevance judgments.model.onnx: dynamic-int8 ONNX rerankerconfig.json: model configtokenizer.jsontokenizer_config.jsonspecial_tokens_map.jsonsentencepiece.bpe.modelartifact_info.json: provenance and quantization detailsbenchmark_summary.json: machine-readable public benchmark summaryfrom huggingface_hub import hf_hub_download
from transformers import AutoTokenizer
import numpy as np
import onnxruntime as ort
repo_id = "temsa/mmarco-mMiniLMv2-L12-H384-v1-onnx-cpu-qint8"
model_path = hf_hub_download(repo_id=repo_id, filename="model.onnx")
tokenizer = AutoTokenizer.from_pretrained(repo_id)
session = ort.InferenceSession(
model_path,
providers=["CPUExecutionProvider"],
)
pairs = [
("how to renew a passport", "Renew your passport online or at a passport office."),
("conas pas a athnuachan", "Is féidir do phas a athnuachan ar líne."),
]
encoded = tokenizer(
[q for q, _ in pairs],
[d for _, d in pairs],
padding=True,
truncation=True,
max_length=256,
return_tensors="np",
)
feed = {k: (v.astype(np.int64) if v.dtype != np.int64 else v) for k, v in encoded.items()}
scores = session.run(None, feed)[0].reshape(-1)
print(scores.tolist())
This artifact was produced from the published fp32 ONNX export of the upstream model using ONNX Runtime dynamic quantization, with no retraining or calibration.