]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
command : update README, show how to use guided mode
authorGeorgi Gerganov <redacted>
Tue, 13 Dec 2022 19:36:29 +0000 (21:36 +0200)
committerGeorgi Gerganov <redacted>
Fri, 16 Dec 2022 17:38:18 +0000 (19:38 +0200)
examples/command/README.md
examples/command/command.cpp

index 3a521fb94440aeab5ff2fb21bc261333505cee90..551409201cac734f629e2b7213a290fd1e1d436d 100644 (file)
@@ -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\r
 \r
 # On Raspberry Pi, use tiny or base models + "-ac 768" for better performance\r
-./command -m ./models/ggml-tiny.en.bin -ac 768 -t 4 -c 0\r
+./command -m ./models/ggml-tiny.en.bin -ac 768 -t 3 -c 0\r
+\r
+# Run in guided mode, the list of allowed commands is in commands.txt\r
+./command -m ./models/ggml-base.en.bin -cmd ./examples/command/commands.txt\r
+\r
+# On Raspberry Pi, in guided mode you can use "-ac 128" for extra performance\r
+./command -m ./models/ggml-tiny.en.bin -cmd ./examples/command/commands.txt -ac 128 -t 3 -c 0\r
 ```\r
 \r
 https://user-images.githubusercontent.com/1991296/204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4\r
index 068233f2b7d7bd2457502d7c91135beda6ad177e..fac0fb0ea37120d06a24520128239492d56c2d8b 100644 (file)
@@ -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;