Instructions to use Rcarvalo/vibevoice with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- VibeVoice
How to use Rcarvalo/vibevoice with VibeVoice:
import torch, soundfile as sf, librosa, numpy as np from vibevoice.processor.vibevoice_processor import VibeVoiceProcessor from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference # Load voice sample (should be 24kHz mono) voice, sr = sf.read("path/to/voice_sample.wav") if voice.ndim > 1: voice = voice.mean(axis=1) if sr != 24000: voice = librosa.resample(voice, sr, 24000) processor = VibeVoiceProcessor.from_pretrained("Rcarvalo/vibevoice") model = VibeVoiceForConditionalGenerationInference.from_pretrained( "Rcarvalo/vibevoice", torch_dtype=torch.bfloat16 ).to("cuda").eval() model.set_ddpm_inference_steps(5) inputs = processor(text=["Speaker 0: Hello!\nSpeaker 1: Hi there!"], voice_samples=[[voice]], return_tensors="pt") audio = model.generate(**inputs, cfg_scale=1.3, tokenizer=processor.tokenizer).speech_outputs[0] sf.write("output.wav", audio.cpu().numpy().squeeze(), 24000) - Notebooks
- Google Colab
- Kaggle
| { | |
| "acoustic_vae_dim": 64, | |
| "acoustic_tokenizer_config": { | |
| "causal": true, | |
| "channels": 1, | |
| "conv_bias": true, | |
| "conv_norm": "none", | |
| "corpus_normalize": 0.0, | |
| "decoder_depths": null, | |
| "decoder_n_filters": 32, | |
| "decoder_ratios": [ | |
| 8, | |
| 5, | |
| 5, | |
| 4, | |
| 2, | |
| 2 | |
| ], | |
| "disable_last_norm": true, | |
| "encoder_depths": "3-3-3-3-3-3-8", | |
| "encoder_n_filters": 32, | |
| "encoder_ratios": [ | |
| 8, | |
| 5, | |
| 5, | |
| 4, | |
| 2, | |
| 2 | |
| ], | |
| "fix_std": 0.5, | |
| "layer_scale_init_value": 1e-06, | |
| "layernorm": "RMSNorm", | |
| "layernorm_elementwise_affine": true, | |
| "layernorm_eps": 1e-05, | |
| "mixer_layer": "depthwise_conv", | |
| "model_type": "vibevoice_acoustic_tokenizer", | |
| "pad_mode": "constant", | |
| "std_dist_type": "gaussian", | |
| "vae_dim": 64, | |
| "weight_init_value": 0.01 | |
| }, | |
| "architectures": [ | |
| "VibeVoiceStreamingForConditionalGenerationInference" | |
| ], | |
| "decoder_config": { | |
| "attention_dropout": 0.0, | |
| "hidden_act": "silu", | |
| "hidden_size": 896, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4864, | |
| "max_position_embeddings": 8192, | |
| "max_window_layers": 24, | |
| "model_type": "qwen2", | |
| "num_attention_heads": 14, | |
| "num_hidden_layers": 24, | |
| "num_key_value_heads": 2, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": null, | |
| "rope_theta": 1000000.0, | |
| "sliding_window": null, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "use_cache": true, | |
| "use_sliding_window": false, | |
| "vocab_size": 151936 | |
| }, | |
| "diffusion_head_config": { | |
| "ddpm_batch_mul": 4, | |
| "ddpm_beta_schedule": "cosine", | |
| "ddpm_num_inference_steps": 20, | |
| "ddpm_num_steps": 1000, | |
| "diffusion_type": "ddpm", | |
| "head_ffn_ratio": 3.0, | |
| "head_layers": 4, | |
| "hidden_size": 896, | |
| "latent_size": 64, | |
| "model_type": "vibevoice_diffusion_head", | |
| "prediction_type": "v_prediction", | |
| "rms_norm_eps": 1e-05, | |
| "speech_vae_dim": 64 | |
| }, | |
| "model_type": "vibevoice_streaming", | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.51.3", | |
| "tts_backbone_num_hidden_layers": 20 | |
| } | |