try the model-baked-in-cli-version

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

1410
rust-whisper-baked/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
[package]
name = "rust-whisper-baked"
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" }
clap = { version = "4.4.10", features = ["derive"] }

View File

@ -0,0 +1,8 @@
#! /bin/bash
#RUSTFLAGS="-Clink-args=-lstd++" \
export C_INCLUDE_PATH="$C_INCLUDE_PATH:$PWD/.."
export LIBRARY_PATH="$LIBRARY_PATH:$PWD/.."
cargo "$@"

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); },
};
},
);
}