Downloads · 30 days
40
21% of all-time downloads
aufklarer/SpeechBrain-ECAPA-VoxLingua107-21M-MLX
SpeechBrain-ECAPA-VoxLingua107-21M-MLX is a audio classification model from aufklarer. 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 mlx. The card lists the license as apache-2.0.
This is a pinned, validated MLX export of speechbrain/lang-id-voxlingua107-ecapa for native Apple Silicon inference. It ranks 107 spoken-language labels.
Downloads · 30 days
40
21% of all-time downloads
All-time downloads
194
Public
Parameters
21.3M
42.6 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors42.6 MB · 100%
From the Hugging Face model README
This is a pinned, validated MLX export of
speechbrain/lang-id-voxlingua107-ecapa
for native Apple Silicon inference. It ranks 107 spoken-language labels.
| Property | Value |
|---|---|
| Parameters | 21.25 million |
| Weights | Safetensors, FLOAT16 |
| Weight size | 40.6 MiB |
| Input | SpeechBrain log-mel [1, frames, 60] |
| Sample rate | 16 kHz |
| Output | 107 log probabilities |
The runtime contract includes sentence-level mean normalization. The exporter compares an independent periodic-Hamming, symmetric-filter frontend with the official SpeechBrain implementation before accepting the weights.
| File | Description |
|---|---|
model.safetensors | MLX-layout ECAPA and classifier weights |
mlx_model.py | Native MLX ECAPA graph |
frontend.py | Reproducible SpeechBrain log-mel frontend |
labels.json | Stable upstream index, code, and name mapping |
config.json | Architecture, frontend, revisions, and checksums |
artifact_manifest.json | SHA-256 and size of every artifact file |
validation.json | PyTorch/MLX parity and local latency measurements |
requirements.txt | Pinned standalone runtime dependencies |
LICENSE | Apache 2.0 license |
| Check | Result |
|---|---|
| Minimum PyTorch/MLX output cosine | 1.000000 |
| Maximum absolute error | 0.008958 |
| Warm local inference | 5.3 ms |
The upstream card reports 6.7% error on a small 33-language development subset, not a complete test over all 107 labels. Product evaluation should use the intended languages, accents, microphones, noise, and short-utterance mix.
import json
import mlx.core as mx
import soundfile as sf
from frontend import compute_fbank
from mlx_model import LanguageIDModel
audio, sample_rate = sf.read("recording.wav", dtype="float32")
assert sample_rate == 16000 and audio.ndim == 1
features = compute_fbank(audio, 60)[None, :, :]
model = LanguageIDModel()
model.load_weights(list(mx.load("model.safetensors").items()), strict=True)
log_probabilities = model(mx.array(features))
mx.eval(log_probabilities)
labels = json.load(open("labels.json", encoding="utf-8"))
best = int(mx.argmax(log_probabilities, axis=-1).item())
print(labels[best], float(mx.exp(log_probabilities[0, best]).item()))
speech language-id recording.wav --top 5
This is a closed-set classifier and is not an unknown-language detector. Keep the original class indexes; normalized aliases belong in application output, not in the model head.
Converted from the official SpeechBrain checkpoint at revision
0253049ae131d6a4be1c4f0d8b0ff483a0f8c8e9. Source and checkpoint hashes are in config.json.