try the model-baked-in-cli-version

This commit is contained in:
Bel LaPointe
2023-12-19 22:24:55 -05:00
parent 9363975178
commit d1ef3e4085
4 changed files with 1445 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
use rust_whisper_lib;
use clap::Parser;
fn main() {
let mut flags = rust_whisper_lib::Flags::parse();
flags.model_path = None;
flags.model_buffer = Some(include_bytes!("../../models/ggml-small.en.bin").to_vec());
rust_whisper_lib::main(
flags,
|result: Result<rust_whisper_lib::Whispered, String>| {
match result {
Ok(whispered) => { println!("{}", whispered.to_string()); },
Err(msg) => { eprintln!("error: {}", msg); },
};
},
);
}