Add safe wrapper for raw dtw parameters
This commit is contained in:
parent
dcfcbced18
commit
da6b410439
5 changed files with 135 additions and 51 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue