Skip to content

Commit

Permalink
Merge pull request ggerganov#7 from rockerBOO/patch-1
Browse files Browse the repository at this point in the history
Update readme with new usage
  • Loading branch information
tazz4843 authored Dec 15, 2022
2 parents 0c84524 + a7cdb54 commit b81c6c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ Rust bindings to [whisper.cpp](https://github.com/ggerganov/whisper.cpp/)

## Usage
```rust
use whisper_rs::{WhisperContext, FullParams, SamplingStrategy};

fn main() {
// load a context and model
let mut ctx = WhisperContext::new("path/to/model").expect("failed to load model");

// create a params object
let mut params = FullParams::new(DecodeStrategy::Greedy { n_past: 0 });
let mut params = FullParams::new(SamplingStrategy::Greedy { n_past: 0 });

// assume we have a buffer of audio data
// here we'll make a fake one, floating point samples, 32 bit, 16KHz, mono
Expand Down

0 comments on commit b81c6c9

Please sign in to comment.