ggerganov commited on
Commit
a73a606
·
1 Parent(s): 0ffb168

command : update README, show how to use guided mode

Browse files
examples/command/README.md CHANGED
@@ -8,7 +8,13 @@ More info is available in [issue #171](https://github.com/ggerganov/whisper.cpp/
8
  ./command -m ./models/ggml-small.en.bin -t 8
9
 
10
  # On Raspberry Pi, use tiny or base models + "-ac 768" for better performance
11
- ./command -m ./models/ggml-tiny.en.bin -ac 768 -t 4 -c 0
 
 
 
 
 
 
12
  ```
13
 
14
  https://user-images.githubusercontent.com/1991296/204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4
 
8
  ./command -m ./models/ggml-small.en.bin -t 8
9
 
10
  # On Raspberry Pi, use tiny or base models + "-ac 768" for better performance
11
+ ./command -m ./models/ggml-tiny.en.bin -ac 768 -t 3 -c 0
12
+
13
+ # Run in guided mode, the list of allowed commands is in commands.txt
14
+ ./command -m ./models/ggml-base.en.bin -cmd ./examples/command/commands.txt
15
+
16
+ # On Raspberry Pi, in guided mode you can use "-ac 128" for extra performance
17
+ ./command -m ./models/ggml-tiny.en.bin -cmd ./examples/command/commands.txt -ac 128 -t 3 -c 0
18
  ```
19
 
20
  https://user-images.githubusercontent.com/1991296/204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4
examples/command/command.cpp CHANGED
@@ -557,6 +557,10 @@ int main(int argc, char ** argv) {
557
 
558
  audio.resume();
559
 
 
 
 
 
560
  int max_len = 0;
561
 
562
  bool is_running = true;
 
557
 
558
  audio.resume();
559
 
560
+ // wait for 1 second to avoid any buffered noise
561
+ std::this_thread::sleep_for(std::chrono::milliseconds(1000));
562
+ audio.clear();
563
+
564
  int max_len = 0;
565
 
566
  bool is_running = true;