marksverdhei/Qwen3-Voice-Embedding-12Hz-1.7B-onnx
By marksverdhei · ↓ 0 · ♥ 3 · Updated 2026-02-23
What's in this repo
This page lists the files in marksverdhei/Qwen3-Voice-Embedding-12Hz-1.7B-onnx, including speaker_encoder_fp16.onnx, speaker_encoder_fp32.onnx, speaker_encoder_int8.onnx.
- 3 ONNX models (.onnx files)
- 5 files, including 3 .onnx, 1 .md
- Last updated 2026-02-23
ONNX files
| File | Size | Download |
|---|---|---|
| speaker_encoder_fp16.onnx | — | Download |
| speaker_encoder_fp32.onnx | — | Download |
| speaker_encoder_int8.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
Qwen3-Voice-Embedding-12Hz-1.7B (ONNX)
ONNX exports of the Qwen3-Voice-Embedding-12Hz-1.7B ECAPA-TDNN speaker encoder. Produces 2048-dimensional x-vector speaker embeddings from audio.
Three quantization variants are provided for different deployment targets:
| File | Format | Size | Use case |
|---|---|---|---|
speaker_encoder_fp32.onnx |
Float32 | 46 MB | Maximum accuracy |
speaker_encoder_fp16.onnx |
Float16 | 23 MB | Browser / GPU inference (recommended) |
speaker_encoder_int8.onnx |
Int8 | 12 MB | Edge / mobile / minimal footprint |
Usage
Python (ONNX Runtime)
import numpy as np
import onnxruntime as ort
import librosa
# Load model
session = ort.InferenceSession("speaker_encoder_fp32.onnx")
# Compute mel spectrogram (must match training preprocessing)
audio, sr = librosa.load("audio.wav", sr=24000, mono=True)
mel = librosa.feature.melspectrogram(
y=audio, sr=24000, n_fft=1024, hop_length=256,
n_mels=128, fmin=0, fmax=12000,
)
mel = np.log(np.clip(mel, a_min=1e-5, a_max=None))
mel = mel.T[np.newaxis, ...] # (1, time, 128)
# Run inference
embedding = session.run(None, {"mel_spectrogram": mel.astype(np.float32)})[0]
# embedding shape: (1, 2048)
Browser (ONNX Runtime Web)
import * as ort from "onnxruntime-web";
const session = await ort.InferenceSession.create("speaker_encoder_fp16.onnx");
// mel: Float32Array of shape [1, time_steps, 128]
const tensor = new ort.Tensor("float32", mel, [1, timeSteps, 128]);
const results = await session.run({ mel_spectrogram: tensor });
const embedding = results.speaker_embedding.data; // Float32Array(2048)
Input / Output
| Name | Shape | Type | |
|---|---|---|---|
| Input | mel_spectrogram |
(batch, time, 128) |
float32 |
| Output | speaker_embedding |
(batch, 2048) |
float32 |
The time axis is dynamic — any length mel spectrogram is accepted.
Audio Preprocessing
| Parameter | Value |
|---|---|
| Sample rate | 24000 Hz |
| FFT size | 1024 |
| Hop length | 256 |
| Mel bins | 128 |
| Frequency range | 0 - 12000 Hz |
| Mel scale | Slaney |
| Compression | log(clamp(x, min=1e-5)) |
Export Details
Exported with torch.onnx.export (opset 18) from the standalone PyTorch model. Verified against PyTorch output (cosine similarity = 1.0, max abs diff < 3e-6).
Related Models
- marksverdhei/Qwen3-Voice-Embedding-12Hz-1.7B — PyTorch source model
- marksverdhei/Qwen3-Voice-Embedding-12Hz-0.6B — 1024-dim variant (PyTorch)
- marksverdhei/Qwen3-Voice-Embedding-12Hz-0.6B-onnx — 1024-dim variant (ONNX)
Citation
@article{qwen3-tts,
title={Qwen3-TTS Technical Report},
author={Hu, Hangrui and Zhu, Xinfa and He, Ting and Guo, Dake and Zhang, Bin and Wang, Xiong and Guo, Zhifang and Jiang, Ziyue and Hao, Hongkun and Guo, Zishan and Zhang, Xinyu and Zhang, Pei and Yang, Baosong and Xu, Jin and Zhou, Jingren and Lin, Junyang},
journal={arXiv preprint arXiv:2601.15621},
year={2026}
}
@article{ecapa-tdnn,
title={ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification},
author={Desplanques, Brecht and Thienpondt, Jenthe and Demuynck, Kris},
journal={Proc. Interspeech},
year={2020}
}
Model info
Created: 2026-02-22
Updated: 2026-02-23
View on Hugging Face