crossencoder-camembert-base-mmarcoFR (ONNX)

ONNX export of antoinelouis/crossencoder-camembert-base-mmarcoFR — a French cross-encoder (CamemBERT-base) 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.

ℹ️ Unlike some other ONNX uploads of this model, this export includes the sequence-classification head, so it outputs a relevance score (logits of shape [batch, 1]) and can actually be used for reranking — not the raw last_hidden_state.

Files

File Description
onnx/model.onnx full precision (fp32), ~443 MB
onnx/model_quantized.onnx int8 dynamic quantization (~111 MB) — loaded by default by Transformers.js

Usage (Transformers.js)

import { AutoModelForSequenceClassification, AutoTokenizer } from '@xenova/transformers';

const model_id = '<your-username>/crossencoder-camembert-base-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

How it was produced

optimum-cli export onnx \
  --model antoinelouis/crossencoder-camembert-base-mmarcoFR \
  --task text-classification --opset 14 ./out/
# then int8 dynamic quantization (onnxruntime, QUInt8) -> onnx/model_quantized.onnx

License

MIT, following the original model.

Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for sneko/crossencoder-camembert-base-mmarcoFR-onnx