# CosyVoice ONNX Artifacts — PROVENANCE ## Source - **Upstream repo**: https://github.com/FunAudioLLM/CosyVoice - **Model weights**: https://huggingface.co/FunAudioLLM/CosyVoice-300M - **License**: Apache-2.0 (code and weights) ## License note The Emilia training corpus is CC-BY-NC-4.0. The **model weights** are independently licensed under Apache-2.0 by the authors; the data license does not restrict downstream model use. This is the same legal position as most foundation model releases. ## Non-AR VC recipe ``` speech_tokenizer_v1.onnx(source_whisper_mel) → content_tokens campplus.onnx(reference_fbank) → speaker_embedding (192d) flow_encoder.onnx(content_tokens) → mu (1, 80, T_mel) flow_decoder.onnx(mu, spk_embed, 10 ODE steps) → mel (1, 80, T_mel) hifigan_f0_source.onnx(mel) → source_1d (NSF harmonic) numpy_stft(source_1d, n_fft=16, hop=4) → source_stft (1, 18, T_stft) hifigan_backbone.onnx(mel, source_stft) → (magnitude, phase) numpy_istft(magnitude, phase, n_fft=16) → waveform @ 22050 Hz ``` The autoregressive LLM (llm.pt) is not used. ## Components | File | Origin | Description | |---|---|---| | `speech_tokenizer_v1.onnx` | upstream HF | SenseVoice content tokenizer | | `campplus.onnx` | upstream HF | CAM++ speaker encoder (192-d) | | `flow_decoder.onnx` | upstream HF | Flow-matching ODE decoder | | `flow_encoder.onnx` | exported | Token embed + 6-block Conformer → mu | | `hifigan_f0_source.onnx` | exported | F0 predictor + NSF source generator | | `hifigan_backbone.onnx` | exported | HiFiGAN conv decoder → STFT coefficients | ## STFT/ISTFT note `aten::stft` / `aten::istft` are not supported at ONNX opset 14. The HiFiGAN is split at the STFT boundary; the adapter implements numpy STFT/ISTFT (n_fft=16, hop_len=4, Hann window) verified at export time against PyTorch. ## Export toolchain `conversion/export_cosyvoice.py` in TigreGotico/voiceclonnx (Apache-2.0)