Jarbas commited on
Commit
c0e3406
·
verified ·
1 Parent(s): e36a73a

knn-vc ONNX export (fp32+int8) with parity reports

Browse files
PROVENANCE.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PROVENANCE
2
+
3
+ | Field | Value |
4
+ |-------|-------|
5
+ | upstream_repo | https://github.com/bshall/knn-vc |
6
+ | upstream_ref | v0.1 |
7
+ | export_script_sha | 93765ec8873cd903289cfd9949aecb06ca68aff0 |
8
+ | export_date | 2026-06-11T13:33:22Z |
9
+ | torch_version | 2.10.0+cu128 |
10
+ | onnx_version | 1.20.1 |
11
+ | platform | Linux-6.18.20-1-lts-x86_64-with-glibc2.43 |
12
+ | wavlm_model | microsoft/wavlm-large |
13
+ | hifigan_checkpoint | prematch_g_02500000.pt |
14
+ | wavlm_layer_extracted | 6 |
15
+
16
+ ## Upstream licence
17
+
18
+ ```
19
+ MIT License
20
+
21
+ Copyright (c) 2023 bshall (Stellenbosch University)
22
+ Copyright (c) 2021 Microsoft Corporation (WavLM-Large weights)
23
+
24
+ Permission is hereby granted, free of charge, to any person obtaining a copy
25
+ of this software and associated documentation files (the "Software"), to deal
26
+ in the Software without restriction, including without limitation the rights
27
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
+ copies of the Software, and to permit persons to whom the Software is
29
+ furnished to do so, subject to the following conditions:
30
+
31
+ The above copyright notice and this permission notice shall be included in all
32
+ copies or substantial portions of the Software.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
+ SOFTWARE.
41
+ ```
README.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: onnxruntime
4
+ tags:
5
+ - voice-conversion
6
+ - onnx
7
+ - vconnx
8
+ - knn-vc
9
+ pipeline_tag: audio-to-audio
10
+ ---
11
+
12
+ # vconnx · kNN-VC (pure ONNX)
13
+
14
+ ONNX export of [kNN-VC](https://github.com/bshall/knn-vc) (Baas et al.,
15
+ Interspeech 2023, MIT) for the **vconnx** voice-conversion library:
16
+ WavLM-Large layer-6 feature extractor + prematched HiFi-GAN vocoder; the
17
+ kNN regression step is pure numpy at inference time. Any-to-any voice
18
+ conversion at 16 kHz, CPU-only.
19
+
20
+ | file | role | size |
21
+ |---|---|---|
22
+ | `wavlm_layer6.onnx` | feature extractor (fp32) | 387 MB |
23
+ | `wavlm_layer6_q8.onnx` | feature extractor (int8) | 98 MB |
24
+ | `hifigan_knnvc.onnx` | vocoder (fp32) | 63 MB |
25
+ | `hifigan_knnvc_q8.onnx` | vocoder (int8) | 25 MB |
26
+
27
+ Export parity vs the torch reference (max abs):
28
+ WavLM see report ·
29
+ HiFi-GAN see report
30
+ (full reports in the repo).
31
+
32
+ ## Usage
33
+
34
+ ```python
35
+ from vconnx import VoiceCloner
36
+ out = VoiceCloner(engine="knnvc").clone_voice("source.wav", "reference.wav")
37
+ ```
38
+
39
+ Provenance and upstream license: see `PROVENANCE.md`. Weights derive from
40
+ [bshall/knn-vc](https://github.com/bshall/knn-vc) (MIT) and
41
+ [microsoft WavLM](https://github.com/microsoft/unilm/tree/master/wavlm) (MIT).
config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "engine": "knn-vc",
3
+ "components": {
4
+ "wavlm_encoder": "wavlm_layer6.onnx",
5
+ "wavlm_encoder_q8": "wavlm_layer6_q8.onnx",
6
+ "hifigan_vocoder": "hifigan_knnvc.onnx",
7
+ "hifigan_vocoder_q8": "hifigan_knnvc_q8.onnx"
8
+ },
9
+ "sample_rates": {
10
+ "input": 16000,
11
+ "output": 16000
12
+ },
13
+ "metadata": {
14
+ "opset": 14,
15
+ "wavlm_layer": 6,
16
+ "knn_default_k": 4,
17
+ "wavlm_source": "microsoft/wavlm-large",
18
+ "hifigan_source": "https://github.com/bshall/knn-vc/releases/download/v0.1/prematch_g_02500000.pt"
19
+ }
20
+ }
hifigan_knnvc.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47ac3ce468e96476b432ad40977a9e90ff9a25bdefe7f2352fdba883997c6671
3
+ size 66133611
hifigan_knnvc_q8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93fe768fd462739ff3bc956245664a3bb038eb450317284abab4af0795ce7e43
3
+ size 26276028
hifigan_parity_report.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "overall_passed": true,
3
+ "tolerances": {
4
+ "max_abs": 0.001,
5
+ "mean_abs": 0.0001
6
+ },
7
+ "components": [
8
+ {
9
+ "name": "waveform",
10
+ "max_abs_delta": 2.4437904357910156e-06,
11
+ "mean_abs_delta": 2.0770487196841714e-07,
12
+ "shape": [
13
+ 1,
14
+ 1,
15
+ 25600
16
+ ],
17
+ "passed": true
18
+ }
19
+ ]
20
+ }
wavlm_layer6.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c0cc7c6648c10b11a0f57f2a5c2fa00b64a37e733860e8f734e8775afc98743
3
+ size 405586979
wavlm_layer6_q8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b16c392b7402ca3065970a580bbda9ef5e29221c0ddc1267720e1f1e20a55a5f
3
+ size 102208980
wavlm_parity_report.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "overall_passed": true,
3
+ "tolerances": {
4
+ "max_abs": 0.001,
5
+ "mean_abs": 0.0001
6
+ },
7
+ "components": [
8
+ {
9
+ "name": "hidden_states",
10
+ "max_abs_delta": 0.00051116943359375,
11
+ "mean_abs_delta": 1.3095690519548953e-05,
12
+ "shape": [
13
+ 1,
14
+ 49,
15
+ 1024
16
+ ],
17
+ "passed": true
18
+ }
19
+ ]
20
+ }