Views
No views yet
| file | note |
|---|---|
onnx/model_quantized.onnx | 141 MB, dynamic INT8, QUInt8 weights |
config.json | unchanged, id2label = entailment / neutral / contradiction (entailment at index 0) |
tokenizer.json | unchanged |
tokenizer_config.json | tokenizer_class normalized to PreTrainedTokenizerFast (see below) |
input_ids + attention_mask only, with no token_type_ids, so it runs on a plain
ONNX Runtime session without a tokenizer type-id pass.| weights | host without VNNI | host with AVX-VNNI |
|---|---|---|
| fp32 (reference) | 0.889 | - |
| QUInt8 (this repo) | 0.847 | 0.849 |
| QInt8 | 0.520 (chance) | 0.867 |
reduce_range=True did lift that host to 0.839. QUInt8 measured the same on both,
so that is what ships.tokenizer_class: TokenizersBackend, which only Transformers v5 resolves: older
Python Transformers raises, and transformers.js falls back to its base class with a warning. This repo
declares PreTrainedTokenizerFast instead. Token ids are unchanged (verified identical on all 72
evaluation pairs); the algorithm lives in tokenizer.json, not in the class name.1import numpy as np, onnxruntime as ort
2from transformers import AutoTokenizer
3
4tok = AutoTokenizer.from_pretrained("Nicolassuez/mmbert-small-nli-onnx-q8")
5sess = ort.InferenceSession("onnx/model_quantized.onnx", providers=["CPUExecutionProvider"])
6
7enc = tok(["The plant opened in 2019."], ["La station a ouvert en 2019."], return_tensors="np")
8logits = sess.run(None, {k: v.astype(np.int64) for k, v in enc.items() if k != "token_type_ids"})[0]
9p = np.exp(logits - logits.max(-1, keepdims=True))
10print("P(entailment) =", (p / p.sum(-1, keepdims=True))[0][0])dtype: 'q8'.