Refine Pocket model metadata exports

Signed-off-by: John Tennant <jtennant@squareup.com>
This commit is contained in:
John Tennant
2026-07-29 18:04:52 -04:00
parent ace19c659e
commit dd46190dc7
3 changed files with 12 additions and 37 deletions
+2 -35
View File
@@ -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,
}
}
+3 -2
View File
@@ -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.
+7
View File
@@ -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],
}