Run this model with HF Jobs
Run moonbox-dev/Vevo-TensorRT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/moonbox-dev/Vevo-TensorRT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/moonbox-dev/Vevo-TensorRT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use moonbox-dev/Vevo-TensorRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use moonbox-dev/Vevo-TensorRT with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Vevo TensorRT
TensorRT engines of Vevo, made by Moonbox for NVIDIA RTX GPUs. Each precision is one folder holding the
engine, trt_runner.py (a small numpy runner: TensorRT plus Polygraphy, no PyTorch) and a script that does the rest
of the pipeline. What the engine takes and returns is under How to run.
Compatibility. The engines are built hardware compatible (Ampere and newer: RTX 30, 40 and 50 series) and
version compatible (any TensorRT 10.x from 10.13 on, through its lean runtime). That costs a little speed against an
engine built for one GPU, but no rebuild is needed. Install the runtime with
pip install "tensorrt-cu12>=10.13,<11" "tensorrt-lean-cu12>=10.13,<11" polygraphy numpy.
Files
The last column is the benchmark (details under How to run).
| Precision | File | Size | sha256 | Benchmark |
|---|---|---|---|---|
| int8 | int8/cond.engine |
77.9 MB | de0a76c5980e |
int8 weights, fp32 math (the engines hold them dequantized: 3.7 vs 1.6 GB): WER 1.05 % / CER 4.17 %, similarity 0.907 / 0.898, DNSMOS 2.92 / 2.89 (the ONNX int8 build 1.05 / 4.17, 0.908 / 0.897, 2.92 / 2.89); RTF 0.421 vs 0.433 |
| int8 | int8/config.json |
0.0 kB | 21abd1bc2f85 |
(the same build: numbers in its first row) |
| int8 | int8/content.engine |
1.14 GB | ad5aa23c835e |
(the same build: numbers in its first row) |
| int8 | int8/estimator.engine |
1.37 GB | d309838a44ec |
(the same build: numbers in its first row) |
| int8 | int8/mel_basis.npy |
0.5 MB | 7bb7e7de4592 |
(the same build: numbers in its first row) |
| int8 | int8/pipeline.py |
7.2 kB | b87a739f78be |
(the same build: numbers in its first row) |
| int8 | int8/pipeline_trt.py |
2.6 kB | 865021bcad63 |
(the same build: numbers in its first row) |
| int8 | int8/trt_runner.py |
4.4 kB | cbc9abb1f59c |
(the same build: numbers in its first row) |
| int8 | int8/vocoder.engine |
1.12 GB | 070b600b6336 |
(the same build: numbers in its first row) |
How to run
Vevo-Timbre as four TensorRT engines plus pipeline_trt.py. It is Amphion's Vevo zero-shot voice conversion: it
re-voices a recording into the timbre of a few seconds of reference audio, keeping its words, timing and speaking
style, with 24 kHz output.
The pipeline is this model's ONNX pipeline.py with its graphs run as engines. That pipeline reproduces the official
VevoInferencePipeline.inference_fm: 32 flow-matching steps, classifier-free guidance 1.0 rescaled 0.75. The
resampling, the reference's mel and the inverse STFT stay in numpy. Vevo's autoregressive models (Vevo-Voice,
Vevo-Style, Vevo-TTS) are not included.
License. The weights are CC BY-NC 4.0: non-commercial use only.
import sys
import soundfile as sf
sys.path.insert(0, "int8")
from pipeline_trt import VevoTimbreTrt
vc = VevoTimbreTrt("int8")
src, ssr = sf.read("source.wav", dtype="float32")
ref, rsr = sf.read("voice.wav", dtype="float32")
out, sr = vc(src, ssr, ref, rsr, seed=0) # 24 kHz
sf.write("converted.wav", out, sr)
Or python int8/pipeline_trt.py source.wav voice.wav converted.wav. It needs numpy, soundfile, soxr, TensorRT 10.13
(tensorrt-cu12 or tensorrt-lean-cu12) and Polygraphy. The engines are version-compatible and built for Ampere or
newer GPUs (RTX 30-series and up).
Limits. A source of up to 30 s and a voice reference of up to 20 s. The flow attends over the reference and the source together, with no chunking, as in the official examples.
The engines.
content.engine: 16 kHz audiowave[1, N] -> content-style tokens [1, N / 320] (50 Hz: HuBERT-large layers 1-18 and the RepCodec quantizer).cond.engine: the reference's and the source's tokens [1, L] -> the flow's condition [1, L, 1024].estimator.engine: the flow-matching transformer.x[1, L, 128] (the reference mel, then the noisy target),t[1] andcond->flow.vocoder.engine: the Vocos vocoder up to its inverse-STFT head. A normalised mel [1, 128, T] -> STFTrealandimag[1, 961, T].
Precisions. int8/ is built from the ONNX int8/ build, the only one published: Vevo's fp16 fails the ONNX
benchmark in Chinese. The weights are int8 behind DequantizeLinear and the math is fp32, as in the ONNX build.
TensorRT stores the dequantized weights in the engines, so they total 3.7 GB against the ONNX build's 1.6 GB.
Benchmark.
- Data: the lab's voice-conversion set: 12 conversions (6 English, 6 Chinese sources into English and Chinese voices), each with the same flow noise in every build, on an RTX 3080 Laptop GPU.
- Score: Whisper's word / character error rate on the output, WavLM speaker similarity to the reference, and DNSMOS.
- Pass mark (set before the first run): against the ONNX
int8/build, the error rate at most 2 points higher, similarity at most 0.03 lower and DNSMOS at most 0.2 lower. That build reproduces the original (Amphion @26f6883, fp32 CUDA) within the same marks.
| WER English | CER Chinese | similarity en / zh | DNSMOS en / zh | real-time factor | |
|---|---|---|---|---|---|
ONNX int8/ (CUDA) |
1.05 % | 4.17 % | 0.908 / 0.897 | 2.92 / 2.89 | 0.433 |
TensorRT int8/ |
1.05 % | 4.17 % | 0.907 / 0.898 | 2.92 / 2.89 | 0.421 |
The two builds' outputs are 14.1 dB apart on average (worst 5.6 dB). The real-time factors were timed in separate processes, alternating, on all 12 conversions.
How these were made
From Vevo at revision 7edf4640c4: each engine was built with TensorRT's builder from Moonbox's published
ONNX graph of the same model and precision. The network is strongly typed: every tensor keeps the precision the
ONNX graph gives it, so an fp16 engine computes what the fp16 ONNX build computes. Built on an RTX 3080 Laptop GPU,
it was benchmarked against the original before upload, and the sha256 column above is what the files must hash to.
License
CC-BY-NC-4.0. These files are a derivative of the original model and carry its license: it is copied in this repository, and it governs your use of these files. The original model card follows unchanged.
Original model card
Vevo: Controllable Zero-Shot Voice Imitation with Self-Supervised Disentanglement
We present our reproduction of Vevo, a versatile zero-shot voice imitation framework with controllable timbre and style. We invite you to explore the audio samples to experience Vevo's capabilities firsthand.
We have included the following pre-trained Vevo models at Amphion:
- Vevo-Timbre: It can conduct style-preserved voice conversion.
- Vevo-Style: It can conduct style conversion, such as accent conversion and emotion conversion.
- Vevo-Voice: It can conduct style-converted voice conversion.
- Vevo-TTS: It can conduct style and timbre controllable TTS.
Besides, we also release the content tokenizer and content-style tokenizer proposed by Vevo. Notably, all these pre-trained models are trained on Emilia, containing 101k hours of speech data among six languages (English, Chinese, German, French, Japanese, and Korean).
Model Introduction
We provide the following pre-trained models:
| Model Name | Description |
|---|---|
| Content Tokenizer | Converting speech to content tokens. It is a single codebook VQ-VAE with a vocabulary size of 32. The frame rate is 50Hz. |
| Content-Style Tokenizer | Converting speech to content-style tokens. It is a single codebook VQ-VAE with a vocabulary size of 8192. The frame rate is 50Hz. |
| Vq32ToVq8192 | Predicting content-style tokens from content tokens with an auto-regressive transformer (480M). |
| PhoneToVq8192 | Predicting content-style tokens from phone tokens with an auto-regressive transformer (740M). |
| Vq8192ToMels | Predicting mel-spectrogram from content-style tokens with a flow-matching transformer (330M). |
| Vocoder | Predicting audio from mel-spectrogram with a Vocos-based vocoder (250M). |
You can download all pretrained checkpoints from HuggingFace or use huggingface API.
Usage
You can refer to our recipe at GitHub for more usage details. For example, to use Vevo-TTS, after you clone the Amphion github repository, you can use the script like:
import os
from huggingface_hub import snapshot_download
from models.vc.vevo.vevo_utils import *
def vevo_tts(
src_text,
ref_wav_path,
timbre_ref_wav_path=None,
output_path=None,
ref_text=None,
src_language="en",
ref_language="en",
):
if timbre_ref_wav_path is None:
timbre_ref_wav_path = ref_wav_path
gen_audio = inference_pipeline.inference_ar_and_fm(
src_wav_path=None,
src_text=src_text,
style_ref_wav_path=ref_wav_path,
timbre_ref_wav_path=timbre_ref_wav_path,
style_ref_wav_text=ref_text,
src_text_language=src_language,
style_ref_wav_text_language=ref_language,
)
assert output_path is not None
save_audio(gen_audio, output_path=output_path)
if __name__ == "__main__":
# ===== Device =====
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
# ===== Content-Style Tokenizer =====
local_dir = snapshot_download(
repo_id="amphion/Vevo",
repo_type="model",
cache_dir="./ckpts/Vevo",
allow_patterns=["tokenizer/vq8192/*"],
)
content_style_tokenizer_ckpt_path = os.path.join(local_dir, "tokenizer/vq8192")
# ===== Autoregressive Transformer =====
local_dir = snapshot_download(
repo_id="amphion/Vevo",
repo_type="model",
cache_dir="./ckpts/Vevo",
allow_patterns=["contentstyle_modeling/PhoneToVq8192/*"],
)
ar_cfg_path = "./models/vc/vevo/config/PhoneToVq8192.json"
ar_ckpt_path = os.path.join(local_dir, "contentstyle_modeling/PhoneToVq8192")
# ===== Flow Matching Transformer =====
local_dir = snapshot_download(
repo_id="amphion/Vevo",
repo_type="model",
cache_dir="./ckpts/Vevo",
allow_patterns=["acoustic_modeling/Vq8192ToMels/*"],
)
fmt_cfg_path = "./models/vc/vevo/config/Vq8192ToMels.json"
fmt_ckpt_path = os.path.join(local_dir, "acoustic_modeling/Vq8192ToMels")
# ===== Vocoder =====
local_dir = snapshot_download(
repo_id="amphion/Vevo",
repo_type="model",
cache_dir="./ckpts/Vevo",
allow_patterns=["acoustic_modeling/Vocoder/*"],
)
vocoder_cfg_path = "./models/vc/vevo/config/Vocoder.json"
vocoder_ckpt_path = os.path.join(local_dir, "acoustic_modeling/Vocoder")
# ===== Inference =====
inference_pipeline = VevoInferencePipeline(
content_style_tokenizer_ckpt_path=content_style_tokenizer_ckpt_path,
ar_cfg_path=ar_cfg_path,
ar_ckpt_path=ar_ckpt_path,
fmt_cfg_path=fmt_cfg_path,
fmt_ckpt_path=fmt_ckpt_path,
vocoder_cfg_path=vocoder_cfg_path,
vocoder_ckpt_path=vocoder_ckpt_path,
device=device,
)
src_text = "I don't really care what you call me. I've been a silent spectator, watching species evolve, empires rise and fall. But always remember, I am mighty and enduring. Respect me and I'll nurture you; ignore me and you shall face the consequences."
ref_wav_path = "./models/vc/vevo/wav/arabic_male.wav"
ref_text = "Flip stood undecided, his ears strained to catch the slightest sound."
# 1. Zero-Shot TTS (the style reference and timbre reference are same)
vevo_tts(
src_text,
ref_wav_path,
output_path="./models/vc/vevo/wav/output_vevotts1.wav",
ref_text=ref_text,
src_language="en",
ref_language="en",
)
# 2. Style and Timbre Controllable Zero-Shot TTS (the style reference and timbre reference are different)
vevo_tts(
src_text,
ref_wav_path,
timbre_ref_wav_path="./models/vc/vevo/wav/mandarin_female.wav",
output_path="./models/vc/vevo/wav/output_vevotts2.wav",
ref_text=ref_text,
src_language="en",
ref_language="en",
)
Citation
If you use Vevo in your research, please cite the following papers:
@inproceedings{vevo,
author = {Xueyao Zhang and Xiaohui Zhang and Kainan Peng and Zhenyu Tang and Vimal Manohar and Yingru Liu and Jeff Hwang and Dangna Li and Yuhao Wang and Julian Chan and Yuan Huang and Zhizheng Wu and Mingbo Ma},
title = {Vevo: Controllable Zero-Shot Voice Imitation with Self-Supervised Disentanglement},
booktitle = {{ICLR}},
publisher = {OpenReview.net},
year = {2025}
}
@article{amphion_v0.2,
title = {Overview of the Amphion Toolkit (v0.2)},
author = {Jiaqi Li and Xueyao Zhang and Yuancheng Wang and Haorui He and Chaoren Wang and Li Wang and Huan Liao and Junyi Ao and Zeyu Xie and Yiqiao Huang and Junan Zhang and Zhizheng Wu},
year = {2025},
journal = {arXiv preprint arXiv:2501.15442},
}
@inproceedings{amphion,
author={Xueyao Zhang and Liumeng Xue and Yicheng Gu and Yuancheng Wang and Jiaqi Li and Haorui He and Chaoren Wang and Ting Song and Xi Chen and Zihao Fang and Haopeng Chen and Junan Zhang and Tze Ying Tang and Lexiao Zou and Mingxuan Wang and Jun Han and Kai Chen and Haizhou Li and Zhizheng Wu},
title={Amphion: An Open-Source Audio, Music and Speech Generation Toolkit},
booktitle={{IEEE} Spoken Language Technology Workshop, {SLT} 2024},
year={2024}
}
- Downloads last month
- -
Model tree for moonbox-dev/Vevo-TensorRT
Base model
Amphion/Vevo