Downloads · 30 days
20
29% of all-time downloads
sneko/crossencoder-camembert-L4-mmarcoFR-onnx
crossencoder-camembert-L4-mmarcoFR-onnx is a text ranking model from sneko. 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 transformers.js. The card lists the license as mit.
ONNX export of antoinelouis/crossencoder-camembert-L4-mmarcoFR — a lightweight 4-layer French cross-encoder (distilled from CamemBERT) trained on mMARCO-fr for passage reranking.
Downloads · 30 days
20
29% of all-time downloads
All-time downloads
70
Public
Repo size
271 MB
Likes
0
Public
Click a slice to open those files.
.onnx270 MB · 99%
From the Hugging Face model README
ONNX export of antoinelouis/crossencoder-camembert-L4-mmarcoFR — a lightweight 4-layer French cross-encoder (distilled from CamemBERT) trained on mMARCO-fr for passage reranking.
All credit for the model goes to the original author. This repository only adds ONNX weights so the model can run with Transformers.js / ONNX Runtime in JavaScript.
This is the 4-layer counterpart of sneko/crossencoder-camembert-base-mmarcoFR-onnx. It trades a bit of ranking quality (mMARCO-fr MRR@10 ≈ 29.2 vs ≈ 33.4 for the base model) for roughly 3× faster CPU inference, which matters a lot when reranking on small, GPU-less instances.
ℹ️ Like the base export, this one includes the sequence-classification head, so it outputs a relevance score (
logitsof shape[batch, 1]) and can actually be used for reranking — not the rawlast_hidden_state.
| File | Description |
|---|---|
onnx/model.onnx | full precision (fp32), ~206 MB |
onnx/model_quantized.onnx | int8 dynamic quantization (~52 MB) — loaded by default by Transformers.js |
import { AutoModelForSequenceClassification, AutoTokenizer } from '@xenova/transformers';
const model_id = 'sneko/crossencoder-camembert-L4-mmarcoFR-onnx';
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const model = await AutoModelForSequenceClassification.from_pretrained(model_id); // uses model_quantized.onnx
const query = 'projets dans la police';
const passages = ['Police nationale : métiers, recrutement et concours', 'Plateforme de photographie'];
const inputs = tokenizer(new Array(passages.length).fill(query), { text_pair: passages, padding: true, truncation: true });
const { logits } = await model(inputs);
const scores = logits
.sigmoid()
.tolist()
.map(([s]) => s); // higher = more relevant
optimum-cli export onnx \
--model antoinelouis/crossencoder-camembert-L4-mmarcoFR \
--task text-classification --opset 14 ./out/
# then int8 dynamic quantization (onnxruntime, QUInt8) -> onnx/model_quantized.onnx
MIT, following the original model.