Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions crates/local-stt-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ pub use hypr_local_model::{AmModel, CactusSttModel, LocalModel, SoniqoModel, Whi
pub static SUPPORTED_MODELS: &[LocalModel] = &[
LocalModel::Soniqo(SoniqoModel::ParakeetStreaming),
LocalModel::Soniqo(SoniqoModel::ParakeetBatch),
LocalModel::Soniqo(SoniqoModel::Omnilingual),
LocalModel::Soniqo(SoniqoModel::Qwen3Small),
LocalModel::Soniqo(SoniqoModel::Qwen3Large),
LocalModel::Am(AmModel::ParakeetV2),
LocalModel::Am(AmModel::ParakeetV3),
LocalModel::Am(AmModel::WhisperLargeV3),
Expand Down Expand Up @@ -87,7 +84,7 @@ mod tests {
})
.collect::<Vec<_>>();

assert_eq!(supported_soniqo_models, SoniqoModel::all());
assert_eq!(supported_soniqo_models, SoniqoModel::selectable());
}

#[test]
Expand Down
46 changes: 38 additions & 8 deletions crates/transcribe-soniqo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,22 @@ pub enum SoniqoModel {
}

impl SoniqoModel {
const ALL: &'static [Self] = &[
Self::ParakeetStreaming,
Self::ParakeetBatch,
Self::Omnilingual,
Self::Qwen3Small,
Self::Qwen3Large,
];

const SELECTABLE: &'static [Self] = &[Self::ParakeetStreaming, Self::ParakeetBatch];

pub const fn all() -> &'static [Self] {
&[
Self::ParakeetStreaming,
Self::ParakeetBatch,
Self::Omnilingual,
Self::Qwen3Small,
Self::Qwen3Large,
]
Self::ALL
}

pub const fn selectable() -> &'static [Self] {
Self::SELECTABLE
}

pub const fn as_str(self) -> &'static str {
Expand Down Expand Up @@ -162,7 +170,7 @@ impl FromStr for SoniqoModel {
type Err = Error;

fn from_str(value: &str) -> Result<Self> {
Self::all()
Self::ALL
.iter()
.copied()
.find(|model| value == model.as_str() || value == model.repo())
Expand Down Expand Up @@ -771,6 +779,28 @@ mod tests {
);
}

#[test]
fn all_includes_every_model_variant() {
assert_eq!(
SoniqoModel::all(),
&[
SoniqoModel::ParakeetStreaming,
SoniqoModel::ParakeetBatch,
SoniqoModel::Omnilingual,
SoniqoModel::Qwen3Small,
SoniqoModel::Qwen3Large,
]
);
}

#[test]
fn selectable_includes_advertised_models() {
assert_eq!(
SoniqoModel::selectable(),
&[SoniqoModel::ParakeetStreaming, SoniqoModel::ParakeetBatch]
);
}

#[test]
fn parakeet_models_support_documented_european_languages() {
let english = "en-US".parse().unwrap();
Expand Down
Loading