functionize at least
parent
5bc3209070
commit
a8c8140d18
|
|
@ -6,7 +6,7 @@ pub fn channel<F>(
|
|||
stream: std::sync::mpsc::Receiver<Vec<f32>>,
|
||||
) where F: FnMut(Result<rust_whisper_lib::Transcribed, String>) + 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<F>(
|
|||
handler_fn: F
|
||||
) where F: FnMut(Result<rust_whisper_lib::Transcribed, String>) + 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<F>(
|
|||
handler_fn: F
|
||||
) where F: FnMut(Result<rust_whisper_lib::Transcribed, String>) + 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<Vec<f32>, String> {
|
||||
rust_whisper_lib::f32_from_wav_file(path)
|
||||
}
|
||||
|
||||
fn get_fast() -> Vec<u8> {
|
||||
include_bytes!("../../models/ggml-base.en.bin").to_vec()
|
||||
}
|
||||
|
||||
fn get_good() -> Vec<u8> {
|
||||
include_bytes!("../../models/ggml-distil-medium.en.bin").to_vec()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue