Skip to content

Commit

Permalink
command : update README, show how to use guided mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Dec 16, 2022
1 parent 6a69e3a commit 5eeeb34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/command/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ More info is available in [issue #171](https://github.com/ggerganov/whisper.cpp/
./command -m ./models/ggml-small.en.bin -t 8

# On Raspberry Pi, use tiny or base models + "-ac 768" for better performance
./command -m ./models/ggml-tiny.en.bin -ac 768 -t 4 -c 0
./command -m ./models/ggml-tiny.en.bin -ac 768 -t 3 -c 0

# Run in guided mode, the list of allowed commands is in commands.txt
./command -m ./models/ggml-base.en.bin -cmd ./examples/command/commands.txt

# On Raspberry Pi, in guided mode you can use "-ac 128" for extra performance
./command -m ./models/ggml-tiny.en.bin -cmd ./examples/command/commands.txt -ac 128 -t 3 -c 0
```

https://user-images.githubusercontent.com/1991296/204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4
Expand Down
4 changes: 4 additions & 0 deletions examples/command/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@ int main(int argc, char ** argv) {

audio.resume();

// wait for 1 second to avoid any buffered noise
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
audio.clear();

int max_len = 0;

bool is_running = true;
Expand Down

0 comments on commit 5eeeb34

Please sign in to comment.