wrap rust-whisper-lib as rust-whisper-baked-lib to cook in a model
This commit is contained in:
1409
rust-whisper-baked-lib/Cargo.lock
generated
Normal file
1409
rust-whisper-baked-lib/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
rust-whisper-baked-lib/Cargo.toml
Normal file
9
rust-whisper-baked-lib/Cargo.toml
Normal 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" }
|
||||
10
rust-whisper-baked-lib/src/lib.rs
Normal file
10
rust-whisper-baked-lib/src/lib.rs
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user