diff --git a/buzz/transcriber/local_whisper_cpp_server_transcriber.py b/buzz/transcriber/local_whisper_cpp_server_transcriber.py index 08f65a7f..580f27bb 100644 --- a/buzz/transcriber/local_whisper_cpp_server_transcriber.py +++ b/buzz/transcriber/local_whisper_cpp_server_transcriber.py @@ -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( diff --git a/buzz/transcriber/recording_transcriber.py b/buzz/transcriber/recording_transcriber.py index d90a59a1..7dbdd635 100644 --- a/buzz/transcriber/recording_transcriber.py +++ b/buzz/transcriber/recording_transcriber.py @@ -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(