Instructions to use baker76/voicegen-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- VoxCPM
How to use baker76/voicegen-models with VoxCPM:
import soundfile as sf from voxcpm import VoxCPM model = VoxCPM.from_pretrained("baker76/voicegen-models") wav = model.generate( text="VoxCPM is an innovative end-to-end TTS model from ModelBest, designed to generate highly expressive speech.", prompt_wav_path=None, # optional: path to a prompt speech for voice cloning prompt_text=None, # optional: reference text cfg_value=2.0, # LM guidance on LocDiT, higher for better adherence to the prompt, but maybe worse inference_timesteps=10, # LocDiT inference timesteps, higher for better result, lower for fast speed normalize=True, # enable external TN tool denoise=True, # enable external Denoise tool retry_badcase=True, # enable retrying mode for some bad cases (unstoppable) retry_badcase_max_times=3, # maximum retrying times retry_badcase_ratio_threshold=6.0, # maximum length restriction for bad case detection (simple but effective), it could be adjusted for slow pace speech ) sf.write("output.wav", wav, 16000) print("saved: output.wav") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from baker76/voicegen-models: direct link, hf CLI and curl.
- Browser
- Download file 1.82 kB
-
https://huggingface.co/baker76/voicegen-models/resolve/main/README.md
- Command line
-
hf download hf://baker76/voicegen-models/README.md
-
curl -L -o README.md https://huggingface.co/baker76/voicegen-models/resolve/main/README.md
1.82 kB
| library_name: onnx | |
| license: apache-2.0 | |
| pipeline_tag: text-to-speech | |
| tags: | |
| - onnx | |
| - voxcpm | |
| - text-to-speech | |
| - voice-cloning | |
| base_model: | |
| - openbmb/VoxCPM2 | |
| # voicegen models | |
| ONNX builds of [VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) (OpenBMB) used by voicegen, a C++ | |
| command-line text-to-speech tool, and by the Baker76 apps Voice Maker and Video Maker. They run on | |
| ONNX Runtime with no Python involved. | |
| Nothing here was trained or fine-tuned by us. Each folder is converted from the original checkpoint | |
| and stays under its Apache-2.0 licence (`LICENSE`); `MODEL_README.md` in each folder is the original | |
| model card. | |
| | Folder | Size | Weights | | |
| | --- | --- | --- | | |
| | `voxcpm2-int8/` | 3.5 GB | 8-bit transformer weights (MatMulNBits, blocks of 32). The default | | |
| | `voxcpm2-int4/` | 2.6 GB | 4-bit language models, 8-bit local encoder and DiT. Smallest | | |
| | `voxcpm2-int8-fp16io/` | 3.0 GB | 8-bit weights with fp16 inputs and outputs, for CUDA | | |
| | `voxcpm2-fp16/` | 5.0 GB | Half precision, for CUDA | | |
| | `voxcpm2-fp32/` | 9.5 GB | Full precision; the reference | | |
| Each folder holds the language model (`lm.onnx`), the diffusion head (`dit.onnx`), the AudioVAE | |
| (`vae_encoder.onnx`, `vae_decoder.onnx`, always fp32), `tokenizer.json` and `voicegen.json`. | |
| ```sh | |
| hf download baker76/voicegen-models --include "voxcpm2-int8/*" --local-dir models | |
| ``` | |
| ## Accuracy | |
| Teacher-forced against fp32 on the same 63 patches: | |
| | Model | DiT conditioning (cosine mean / min) | Relative error | Stop decisions changed | | |
| | --- | --- | --- | --- | | |
| | int8 | 0.99981 / 0.99964 | 1.9% | 0 of 63 | | |
| | int4 (DiT int8) | 0.99663 / 0.99214 | 8.2% | 0 of 63 | | |
| Free-running, every precision produced speech that Whisper transcribes word for word (English, | |
| Chinese, voice design, cloning), with durations within 3% of fp32. | |