mDenseOn โ ONNX export used by Crible
This repository hosts the ONNX export of lightonai/mDenseOn that the integration tests of Crible run. It is not an official LightOn model.
Origin
- Base model:
lightonai/mDenseOn - Upstream revision:
a5fdb000f7a21da96c3bddde3a782ef777316df3 - License: Apache-2.0. The upstream repository declares Apache-2.0 in its model
card and contains no separate
LICENSEorNOTICEfile; the licence text is provided here inLICENSE.
Modifications
The files were produced by Crible from the pinned revision above:
- fp32 ONNX export by
torch.onnx.export, undertransformers5.14.1; - INT8 dynamic quantization by
onnxruntime.quantization; - export script:
tools/export_onnx.pyof the Crible repository, https://github.com/mattboll514/crible.
Encoding contract
The graph returns the last hidden state (last_hidden_state) of the transformer.
It applies neither the prompt nor the pooling, which Crible does itself:
- prompts:
query:for queries anddocument:for documents, trailing space included; - pooling: CLS (position 0 of the output);
- normalization: L2, after pooling;
- dimensions: 768;
max_tokens: 8192, prompt included;- sequence length and batch size are dynamic axes.
These values are the ones declared in model.json, which Crible reads.
Files
| File | Contents | BLAKE3 |
|---|---|---|
model.onnx |
fp32 graph, weights inline (1 227 955 436 bytes) | 7b6eb68099dbeac6826e282dd575aec766dfbe1bedac143bae094b12f82094a2 |
model.int8.onnx |
INT8 dynamic-quantized graph (307 302 578 bytes) | 0534b4ee028cfc4a6a7ca9dcca7a7c908110372033dab33a4f75fbe37d5941a5 |
tokenizer.json |
Hugging Face fast tokenizer, copied as is (34 363 287 bytes) | 8a801317cfb1eb744734392dc0aeef36d6d39660a0a884f06a0338e9bb5357db |
model.json |
Crible model description: revision, prompts, pooling, limits, file digests | 19667080a2d779857691186ad1c6199ec72aac0b1fe6fc0ed07f06b6116c737a |
The four files are byte-exact copies of the export measured for Crible.
Fidelity
The export is checked against the vectors Crible already produced for
Legifacile, and against PyTorch, in the MES-04 campaign
(docs/mesures/MES-04-parite-encodeur.md of the Crible repository):
- PyTorch versus ONNX fp32, on 100 deterministic French texts: minimum cosine
0.9999999998854414, mean0.9999999999971361; - ONNX fp32 with the document prompt versus the production vectors, on 600
passages of the Legifacile sample: minimum cosine
0.9999603983011769, p10.9999935038784599, median0.9999983369936447. The acceptance threshold of Crible is0.999.
The test at 1e-4 in Crible is a guard rail; MES-04 is the fidelity measurement.
License
Apache-2.0. See LICENSE for the full text. Any redistribution of these files
must keep that licence and this model card.
Model tree for mattboll/mdenseon-onnx
Base model
jhu-clsp/mmBERT-base