mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Fix for windows (#1204)
This commit is contained in:
parent
94bb0af427
commit
ce0cc5bd81
2 changed files with 8 additions and 4 deletions
|
|
@ -48,7 +48,9 @@ class LocalWhisperCppServerTranscriber(OpenAIWhisperAPIFileTranscriber):
|
|||
logging.debug(f"Whisper server started successfully.")
|
||||
logging.debug(f"Model: {task.model_path}")
|
||||
else:
|
||||
stderr_output = self.process.stderr.read().decode()
|
||||
stderr_output = ""
|
||||
if self.process.stderr is not None:
|
||||
stderr_output = self.process.stderr.read().decode()
|
||||
logging.error(f"Whisper server failed to start. Error: {stderr_output}")
|
||||
self.initialization_error = _("Whisper server failed to start. Check logs for details.")
|
||||
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ class RecordingTranscriber(QObject):
|
|||
self.process = subprocess.Popen(
|
||||
command,
|
||||
stdout=subprocess.DEVNULL, # For debug set to subprocess.PIPE, but it will freeze on Windows after ~30 seconds
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL,
|
||||
shell=False,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW
|
||||
)
|
||||
|
|
@ -379,7 +379,9 @@ class RecordingTranscriber(QObject):
|
|||
logging.debug(f"Whisper server started successfully.")
|
||||
logging.debug(f"Model: {self.model_path}")
|
||||
else:
|
||||
stderr_output = self.process.stderr.read().decode()
|
||||
stderr_output = ""
|
||||
if self.process.stderr is not None:
|
||||
stderr_output = self.process.stderr.read().decode()
|
||||
logging.error(f"Whisper server failed to start. Error: {stderr_output}")
|
||||
|
||||
self.transcription.emit(_("Whisper server failed to start. Check logs for details."))
|
||||
|
|
@ -397,7 +399,7 @@ class RecordingTranscriber(QObject):
|
|||
self.openai_client = OpenAI(
|
||||
api_key="not-used",
|
||||
base_url="http://127.0.0.1:3004",
|
||||
timeout=10.0,
|
||||
timeout=30.0,
|
||||
max_retries=0
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue