From 4e5212a9b778fb9355022a826254cf69b884af62 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 31 Mar 2023 11:03:57 -0600 Subject: [PATCH] hotwords uses installed rust-whisper --- whisper-cpp-2023/hotwords.py | 2 +- whisper-cpp-2023/requirements.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 whisper-cpp-2023/requirements.txt diff --git a/whisper-cpp-2023/hotwords.py b/whisper-cpp-2023/hotwords.py index 1daa127..71475bd 100644 --- a/whisper-cpp-2023/hotwords.py +++ b/whisper-cpp-2023/hotwords.py @@ -113,7 +113,7 @@ class Parser(threading.Thread): p = "/tmp/whisper-cpp.wav" with open("/tmp/whisper-cpp.wav", "wb") as f: f.write(wav) - proc = subprocess.run(f"./main -m ./models/ggml-{os.environ.get('MODEL','tiny.en')}.bin -t 4 -f {p} --no-timestamps".split(), capture_output=True) + proc = subprocess.run(f"MODEL=./models/ggml-{os.environ.get('MODEL','tiny.en')}.bin WAV={p} P=2 rust-whisper", capture_output=True, shell=True) result = proc.stdout.decode().strip() if os.environ.get("DEBUG", None): log("raw transcript:", result) diff --git a/whisper-cpp-2023/requirements.txt b/whisper-cpp-2023/requirements.txt new file mode 100644 index 0000000..53195f9 --- /dev/null +++ b/whisper-cpp-2023/requirements.txt @@ -0,0 +1,4 @@ +git+https://github.com/openai/whisper.git +soundfile +PyAudio +SpeechRecognition