- Add suppress_blank=True and suppress_non_speech_tokens=True parameters to whisper.cpp Model initialization to prevent blank audio tokens from being output when transcribing silent audio - This implements Option 2 from the investigation: suppress at the whisper.cpp level rather than post-processing filtering - Root cause: whisper.cpp outputs a special [BLANK_AUDIO] token when transcribing silent audio, which was being inserted into the text field when users paused with the mic on
This commit is contained in:
@@ -633,7 +633,12 @@ class SpeechRecognitionManager:
|
||||
cpu_count = multiprocessing.cpu_count()
|
||||
|
||||
load_start_time = time.time()
|
||||
self.model = Model(model_path, n_threads=n_threads)
|
||||
self.model = Model(
|
||||
model_path,
|
||||
n_threads=n_threads,
|
||||
suppress_blank=True,
|
||||
suppress_non_speech_tokens=True,
|
||||
)
|
||||
load_duration = time.time() - load_start_time
|
||||
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user