From eda12d9cb6d46b85760ca56841f84f531a51dd29 Mon Sep 17 00:00:00 2001 From: bel Date: Tue, 28 Mar 2023 20:07:56 -0600 Subject: [PATCH] explicit break on None and dont run speech if nothing in hotwords --- whisper-2023/hotwords.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/whisper-2023/hotwords.py b/whisper-2023/hotwords.py index 78b2c3d..d845a6a 100644 --- a/whisper-2023/hotwords.py +++ b/whisper-2023/hotwords.py @@ -108,7 +108,7 @@ class Parser(threading.Thread): while True: try: clip = self.inq.get() - if not clip: + if clip is None: break self.outq.put(self._run(clip).strip()) except Exception as e: @@ -222,7 +222,6 @@ class Reactor(threading.Thread): if environ.get("DEBUG", None): log(f"seeking {hotwords} in {text}") if not hotwords: - self.outq.put(("", text)) return cleantext = "".join([i for i in "".join(text.lower().split()) if i.isalpha()]) for i in hotwords: