diff --git a/rust-whisper-baked-lib/src/lib.rs b/rust-whisper-baked-lib/src/lib.rs index 988a2d2..b28c118 100644 --- a/rust-whisper-baked-lib/src/lib.rs +++ b/rust-whisper-baked-lib/src/lib.rs @@ -6,7 +6,7 @@ pub fn channel( stream: std::sync::mpsc::Receiver>, ) where F: FnMut(Result) + Send + 'static { flags.model_path = None; - flags.model_buffer = Some(include_bytes!("../../models/ggml-tiny.en.bin").to_vec()); + flags.model_buffer = Some(get_fast()); rust_whisper_lib::channel(flags.clone(), handler_fn, stream); } @@ -15,7 +15,7 @@ pub fn wav( handler_fn: F ) where F: FnMut(Result) + Send + 'static { flags.model_path = None; - flags.model_buffer = Some(include_bytes!("../../models/ggml-distil-medium.en.bin").to_vec()); + flags.model_buffer = Some(get_good()); rust_whisper_lib::wav(flags.clone(), handler_fn, flags.wav.unwrap()); } @@ -24,10 +24,18 @@ pub fn wav_channel( handler_fn: F ) where F: FnMut(Result) + Send + 'static { flags.model_path = None; - flags.model_buffer = Some(include_bytes!("../../models/ggml-distil-medium.en.bin").to_vec()); + flags.model_buffer = Some(get_good()); rust_whisper_lib::wav_channel(flags, handler_fn); } pub fn f32_from_wav_file(path: &String) -> Result, String> { rust_whisper_lib::f32_from_wav_file(path) } + +fn get_fast() -> Vec { + include_bytes!("../../models/ggml-base.en.bin").to_vec() +} + +fn get_good() -> Vec { + include_bytes!("../../models/ggml-distil-medium.en.bin").to_vec() +}