Project-Bastion commited on
Commit
8b93f54
·
verified ·
1 Parent(s): 9e6c077

card: weight-only int8 ONNX (151 MB) with agreement numbers

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -71,8 +71,8 @@ Code: GitHub `Project-Bastion/models`, `scripts/ttp/`.
71
 
72
  ## ONNX / browser
73
 
74
- `onnx/model.onnx` (fp32, **599 MB**) is published for transformers.js / onnxruntime. Checked against PyTorch on 200 validation sentences: onnxruntime fp32 differs by <1e-5 in probability; the in-browser code path (run in Node with transformers.js) gives identical decisions at the 0.2 threshold on all 200 sentences, with probabilities identical for 197 of them and within 0.014 on 3 long inputs (the demo works around a transformers.js quirk that drops the closing `[SEP]` when it truncates; a small residual on very long inputs remains, cause not fully isolated).
75
- **int8 quantization does not work for this model**: four dynamic-quantization recipes kept only 91-94% of decisions, so no int8 file is published. The demo therefore downloads the full 599 MB once.
76
 
77
  ## Known limits
78
 
 
71
 
72
  ## ONNX / browser
73
 
74
+ `onnx/model.onnx` (fp32, **599 MB**) and `onnx/model_quantized.onnx` (weight-only int8, 151 MB) are published for transformers.js / onnxruntime. Checked against PyTorch on 200 validation sentences: onnxruntime fp32 differs by <1e-5 in probability; the in-browser code path (run in Node with transformers.js) gives identical decisions at the 0.2 threshold on all 200 sentences, with probabilities identical for 197 of them and within 0.014 on 3 long inputs (the demo works around a transformers.js quirk that drops the closing `[SEP]` when it truncates; a small residual on very long inputs remains, cause not fully isolated).
75
+ **Weight-only int8** (`onnx/model_quantized.onnx`, **151 MB**, the demo default): int8 weights with per-channel scales are dequantized at load while activations stay fp32. On 200 validation sentences it gives the same thresholded decisions as PyTorch for 198 (browser stack) / 197 (onnxruntime) of 200, mean probability change 0.0001, max 0.16; an int8 run can add or drop a low-confidence tag near the 0.2 threshold (for example the demo's last sample sentence gets an extra T1070.004 at 0.28 in int8 only). Standard dynamic int8 (91-94% of decisions kept) and static int8 with calibration (0% kept; ModernBERT activation outliers get clipped) do **not** work for this model, which is why the recipe quantizes weights only. Use the 599 MB fp32 file for exact agreement with the Python reference.
76
 
77
  ## Known limits
78