Skip to content

Commit 3f2cc05

Browse files
fix(stt): limit Soniqo model options
Only advertise Soniqo Parakeet Streaming and Parakeet Batch while keeping legacy Soniqo model IDs parseable.
1 parent b2ea1c7 commit 3f2cc05

2 files changed

Lines changed: 39 additions & 12 deletions

File tree

crates/local-stt-core/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ pub use hypr_local_model::{AmModel, CactusSttModel, LocalModel, SoniqoModel, Whi
33
pub static SUPPORTED_MODELS: &[LocalModel] = &[
44
LocalModel::Soniqo(SoniqoModel::ParakeetStreaming),
55
LocalModel::Soniqo(SoniqoModel::ParakeetBatch),
6-
LocalModel::Soniqo(SoniqoModel::Omnilingual),
7-
LocalModel::Soniqo(SoniqoModel::Qwen3Small),
8-
LocalModel::Soniqo(SoniqoModel::Qwen3Large),
96
LocalModel::Am(AmModel::ParakeetV2),
107
LocalModel::Am(AmModel::ParakeetV3),
118
LocalModel::Am(AmModel::WhisperLargeV3),
@@ -87,7 +84,7 @@ mod tests {
8784
})
8885
.collect::<Vec<_>>();
8986

90-
assert_eq!(supported_soniqo_models, SoniqoModel::all());
87+
assert_eq!(supported_soniqo_models, SoniqoModel::selectable());
9188
}
9289

9390
#[test]

crates/transcribe-soniqo/src/lib.rs

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,22 @@ pub enum SoniqoModel {
6464
}
6565

6666
impl SoniqoModel {
67+
const ALL: &'static [Self] = &[
68+
Self::ParakeetStreaming,
69+
Self::ParakeetBatch,
70+
Self::Omnilingual,
71+
Self::Qwen3Small,
72+
Self::Qwen3Large,
73+
];
74+
75+
const SELECTABLE: &'static [Self] = &[Self::ParakeetStreaming, Self::ParakeetBatch];
76+
6777
pub const fn all() -> &'static [Self] {
68-
&[
69-
Self::ParakeetStreaming,
70-
Self::ParakeetBatch,
71-
Self::Omnilingual,
72-
Self::Qwen3Small,
73-
Self::Qwen3Large,
74-
]
78+
Self::ALL
79+
}
80+
81+
pub const fn selectable() -> &'static [Self] {
82+
Self::SELECTABLE
7583
}
7684

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

164172
fn from_str(value: &str) -> Result<Self> {
165-
Self::all()
173+
Self::ALL
166174
.iter()
167175
.copied()
168176
.find(|model| value == model.as_str() || value == model.repo())
@@ -771,6 +779,28 @@ mod tests {
771779
);
772780
}
773781

782+
#[test]
783+
fn all_includes_every_model_variant() {
784+
assert_eq!(
785+
SoniqoModel::all(),
786+
&[
787+
SoniqoModel::ParakeetStreaming,
788+
SoniqoModel::ParakeetBatch,
789+
SoniqoModel::Omnilingual,
790+
SoniqoModel::Qwen3Small,
791+
SoniqoModel::Qwen3Large,
792+
]
793+
);
794+
}
795+
796+
#[test]
797+
fn selectable_includes_advertised_models() {
798+
assert_eq!(
799+
SoniqoModel::selectable(),
800+
&[SoniqoModel::ParakeetStreaming, SoniqoModel::ParakeetBatch]
801+
);
802+
}
803+
774804
#[test]
775805
fn parakeet_models_support_documented_european_languages() {
776806
let english = "en-US".parse().unwrap();

0 commit comments

Comments
 (0)