Add safe wrapper for raw dtw parameters

This commit is contained in:
arizhih 2024-05-16 18:58:48 +02:00
parent dcfcbced18
commit da6b410439
5 changed files with 135 additions and 51 deletions

View file

@ -11,7 +11,7 @@ fn main() -> Result<(), &'static str> {
// Load a context and model.
let ctx = WhisperContext::new_with_params(
"example/path/to/model/whisper.cpp/models/ggml-base.en.bin",
WhisperContextParameters::default(),
&mut WhisperContextParameters::default(),
)
.expect("failed to load model");
// Create a state

View file

@ -7,7 +7,7 @@ use whisper_rs::{FullParams, SamplingStrategy, WhisperContext, WhisperContextPar
// more dependencies than the base library.
pub fn usage() -> Result<(), &'static str> {
// load a context and model
let ctx = WhisperContext::new_with_params("path/to/model", WhisperContextParameters::default())
let ctx = WhisperContext::new_with_params("path/to/model", &mut WhisperContextParameters::default())
.expect("failed to load model");
// make a state
let mut state = ctx.create_state().expect("failed to create state");