wrap rust-whisper-lib as rust-whisper-baked-lib to cook in a model

master
Bel LaPointe 2023-12-19 22:29:10 -05:00
parent d1ef3e4085
commit 7a9cdd7e4f
3 changed files with 1428 additions and 0 deletions

1409
rust-whisper-baked-lib/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
[package]
name = "rust-whisper-baked-lib"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rust-whisper-lib = { path = "../rust-whisper-lib" }

View File

@ -0,0 +1,10 @@
use rust_whisper_lib;
pub fn main<F>(
mut flags: rust_whisper_lib::Flags,
handler_fn: F
) where F: FnMut(Result<rust_whisper_lib::Whispered, String>) + Send + 'static {
flags.model_path = None;
flags.model_buffer = Some(include_bytes!("../../models/ggml-small.en.bin").to_vec());
rust_whisper_lib::main(flags, handler_fn);
}