diff --git a/crates/buzz-voice/src/lib.rs b/crates/buzz-voice/src/lib.rs index c0d4a05c5..a47f9149c 100644 --- a/crates/buzz-voice/src/lib.rs +++ b/crates/buzz-voice/src/lib.rs @@ -3,8 +3,8 @@ pub mod pocket; pub use pocket::{ - load_text_to_speech, load_voice_style, PocketTts, VoiceStyle, DEFAULT_VOICE, SAMPLE_RATE, - VOICE_FILE_EXT, + april_model_info, load_text_to_speech, load_voice_style, PocketModelInfo, PocketTts, + VoiceStyle, DEFAULT_VOICE, SAMPLE_RATE, VOICE_FILE_EXT, }; /// One immutable artifact required by the April Pocket bundle. @@ -14,42 +14,9 @@ pub use pocket::{ /// identifies the INT8 components. pub type PocketModelArtifact = pocket::PocketModelArtifact; -/// Capabilities of Buzz Desktop's April Pocket model. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct PocketModelInfo { - /// Language bundle selected from the pinned export. - pub bundle_id: &'static str, - /// Upstream model repository. - pub source_model_id: &'static str, - /// Pinned upstream model revision. - pub revision: &'static str, - /// PCM output sample rate. - pub sample_rate: u32, - /// Maximum input size declared by the bundle. - pub max_token_per_chunk: usize, - /// Immutable files required by the runtime. - pub artifacts: &'static [PocketModelArtifact], - /// Components quantized in the selected bundle. - pub quantized_components: &'static [&'static str], -} - /// Language bundle selected from the pinned export. pub const APRIL_BUNDLE_ID: &str = pocket::APRIL_BUNDLE_ID; /// Pinned upstream export repository. pub const APRIL_MODEL_ID: &str = pocket::APRIL_MODEL_ID; /// Pinned revision containing the April bundle. pub const APRIL_MODEL_REVISION: &str = pocket::APRIL_MODEL_REVISION; - -/// Return immutable metadata for Buzz Desktop's April Pocket model. -pub const fn april_model_info() -> PocketModelInfo { - let info = pocket::april_model_info(); - PocketModelInfo { - bundle_id: info.bundle_id, - source_model_id: info.source_model_id, - revision: info.revision, - sample_rate: info.sample_rate, - max_token_per_chunk: info.max_token_per_chunk, - artifacts: info.artifacts, - quantized_components: info.quantized_components, - } -} diff --git a/crates/buzz-voice/src/pocket.rs b/crates/buzz-voice/src/pocket.rs index 2154a25c2..0c6174a8d 100644 --- a/crates/buzz-voice/src/pocket.rs +++ b/crates/buzz-voice/src/pocket.rs @@ -24,8 +24,9 @@ mod pocket_april; mod pocket_models; use pocket_april::{prepare_april_prompt, AprilPocketTts}; -pub(crate) use pocket_models::{ - april_model_info, PocketModelArtifact, APRIL_BUNDLE_ID, APRIL_MODEL_ID, APRIL_MODEL_REVISION, +pub use pocket_models::{ + april_model_info, PocketModelArtifact, PocketModelInfo, APRIL_BUNDLE_ID, APRIL_MODEL_ID, + APRIL_MODEL_REVISION, }; /// Pocket TTS emits 24 kHz mono PCM. diff --git a/crates/buzz-voice/src/pocket_models.rs b/crates/buzz-voice/src/pocket_models.rs index de34c77a7..ba3f92849 100644 --- a/crates/buzz-voice/src/pocket_models.rs +++ b/crates/buzz-voice/src/pocket_models.rs @@ -24,12 +24,19 @@ pub struct PocketModelArtifact { /// Capabilities of Buzz Desktop's sole Pocket model. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct PocketModelInfo { + /// Language bundle selected from the pinned export. pub bundle_id: &'static str, + /// Upstream model repository. pub source_model_id: &'static str, + /// Pinned upstream model revision. pub revision: &'static str, + /// PCM output sample rate. pub sample_rate: u32, + /// Maximum input size declared by the bundle. pub max_token_per_chunk: usize, + /// Immutable files required by the runtime. pub artifacts: &'static [PocketModelArtifact], + /// Components quantized in the selected bundle. pub quantized_components: &'static [&'static str], }