Fix for whisper server language detection (#1198)

This commit is contained in:
Raivis Dejus 2025-07-22 21:57:59 +03:00 committed by GitHub
commit 261e532818
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -24,11 +24,13 @@ class LocalWhisperCppServerTranscriber(OpenAIWhisperAPIFileTranscriber):
os.path.join(APP_BASE_DIR, "whisper-server.exe"),
"--port", "3000",
"--inference-path", "/audio/transcriptions",
"--threads", str(os.getenv("BUZZ_WHISPERCPP_N_THREADS", (os.cpu_count() or 8)//2)),
"--language", task.transcription_options.language,
"--threads", str(os.getenv("BUZZ_WHISPERCPP_N_THREADS", (os.cpu_count() or 8) // 2)),
"--model", task.model_path
]
if task.transcription_options.language is not None:
command.extend(["--language", task.transcription_options.language])
logging.debug(f"Starting Whisper server with command: {' '.join(command)}")
self.process = subprocess.Popen(

View file

@ -353,13 +353,15 @@ class RecordingTranscriber(QObject):
os.path.join(APP_BASE_DIR, "whisper-server.exe"),
"--port", "3004",
"--inference-path", "/audio/transcriptions",
"--threads", str(os.getenv("BUZZ_WHISPERCPP_N_THREADS", (os.cpu_count() or 8)//2)),
"--language", self.transcription_options.language,
"--threads", str(os.getenv("BUZZ_WHISPERCPP_N_THREADS", (os.cpu_count() or 8) // 2)),
"--model", self.model_path,
"--no-timestamps",
"--no-context", # on Windows context causes duplications of last message
]
if self.transcription_options.language is not None:
command.extend(["--language", self.transcription_options.language])
logging.debug(f"Starting Whisper server with command: {' '.join(command)}")
self.process = subprocess.Popen(