Downloads · 30 days
0
DimQ1/sortformer-4spk-v2-onnx-int4-cpu
sortformer-4spk-v2-onnx-int4-cpu is a audio classification model from DimQ1. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as cc-by-4.0.
INT4 quantized ONNX model of NVIDIA's Sortformer 4spk-v2 speaker diarization. Uses MatMulNBits (ORT ≥ 1.18) for 4-bit weight compression with the best accuracy-to-size ratio.
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2026
Repo size
142 MB
Likes
0
Public
Click a slice to open those files.
.data120 MB · 85%
From the Hugging Face model README
INT4 quantized ONNX model of NVIDIA's Sortformer 4spk-v2 speaker diarization. Uses MatMulNBits (ORT ≥ 1.18) for 4-bit weight compression with the best accuracy-to-size ratio.
processed_signal — log-mel spectrogram [B, 128, mel_frames]speaker_logits — per-frame sigmoid probabilities [B, diar_frames, 4]Audio (16 kHz mono) → STFT → 128 mel bins
→ ConformerEncoder (17 layers, d=512)
→ SortformerModules (4 speakers)
→ TransformerEncoder (18 layers, d=192)
→ Sigmoid → [B, diar_frames, 4] speaker logits
All 265 constant-weight MatMul nodes replaced with MatMulNBits (INT4, block_size=32). The finer block_size=32 gives better accuracy than INT8 despite 4-bit weights. 87 dynamic MatMul nodes (attention scores) remain in FP32.
| Metric | Value |
|---|---|
| RTF | 0.043 (23× real-time) |
| DER | 19.11% (LibriCSS test set) |
| Size | 135 MB (3.5× smaller than FP32) |
| cos_sim vs FP32 | 0.996–0.999 |
Benchmarked on 100-file LibriCSS subset (1954.8 s audio). ORT 1.27.1 with ORT_PARALLEL + memory optimizations.
⚡ INT4 is more accurate than INT8 (DER 19.11% vs 21.64%) due to finer block_size=32 quantization granularity. Best accuracy-to-size ratio for production.
| Variant | Size | DER | RTF | Link |
|---|---|---|---|---|
| FP32 | 469 MB | 17.82% | 0.037 | sortformer-4spk-v2-onnx-fp32-cpu |
| INT8 | 129 MB | 21.64% | 0.034 | sortformer-4spk-v2-onnx-int8-cpu |
.data file must be in the same directory as sortformer.onnximport onnxruntime as ort
session = ort.InferenceSession(
"sortformer.onnx",
providers=["CPUExecutionProvider"],
)
speaker_logits = session.run(None, {"processed_signal": mel})[0]
using var session = new InferenceSession("sortformer.onnx");
var inputs = new List<NamedOnnxValue>
{
NamedOnnxValue.CreateFromTensor("processed_signal", melTensor),
};
using var results = session.Run(inputs);
Quantized from FP32 ONNX using MatMulNBitsQuantizer (ORT ≥ 1.18, opset 21):
python scripts/quantize_nbits.py --int4
See nemotron-speech-csharp/DiarizationConverter