1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! # voxcpm-rs
//!
//! Pure-Rust inference for [VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) built on top
//! of the [Burn](https://burn.dev) ML framework. Supports Vulkan (via `wgpu`) and a CPU
//! fallback through `ndarray`.
//!
//! ## Quick start
//!
//! ```no_run
//! # #[cfg(feature = "cpu")] {
//! use voxcpm_rs::{GenerateOptions, Prompt, PromptAudio, VoxCPM};
//!
//! type B = burn::backend::NdArray<f32>;
//! let device = Default::default();
//! let model: VoxCPM<B> = VoxCPM::from_local("./pretrained_models/VoxCPM2", &device).unwrap();
//!
//! // Zero-shot:
//! let wav = model.generate("Hello, world!", GenerateOptions::default()).unwrap();
//!
//! // Voice cloning from a reference wav:
//! let opts = GenerateOptions::builder()
//! .timesteps(10)
//! .prompt(Prompt::Reference { audio: "speaker.wav".into() })
//! .build();
//! let wav = model.generate("Hello, world!", opts).unwrap();
//!
//! voxcpm_rs::audio::write_wav("out.wav", &wav, model.sample_rate()).unwrap();
//! # }
//! ```
//!
//! See the [`VoxCPM`] struct for the convenience API, or the individual submodules
//! ([`minicpm4`], [`locdit`], [`locenc`], [`audiovae`]) for low-level access.
// Bumped from the default 128 because enabling burn's `fusion` + `autotune`
// features pushes the wgpu-core / naga generic chain past the limit.
pub use AudioVae;
pub use ;
pub use ;
pub use ;