Skip to content

Commit

Permalink
Fix Whisper.cpp on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
chidiwilliams committed Apr 29, 2023
1 parent 7909ae1 commit a9ad52d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion buzz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class CommandLineModelType(enum.Enum):

def parse_command_line(app: Application):
parser = QCommandLineParser()

try:
parse(app, parser)
except CommandLineError as exc:
Expand Down
5 changes: 4 additions & 1 deletion buzz/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def on_transcription_options_changed(self, transcription_options: TranscriptionO
self.transcription_options = transcription_options
self.word_level_timings_checkbox.setDisabled(
self.transcription_options.model.model_type == ModelType.HUGGING_FACE or self.transcription_options.model.model_type == ModelType.OPEN_AI_WHISPER_API)
if self.transcription_options.openai_access_token is not None:
if self.transcription_options.openai_access_token != '':
self.openai_access_token_changed.emit(self.transcription_options.openai_access_token)

def on_click_run(self):
Expand Down Expand Up @@ -1378,6 +1378,9 @@ class Application(QApplication):
def __init__(self) -> None:
super().__init__(sys.argv)

self.setApplicationName(APP_NAME)
self.setApplicationVersion(VERSION)

self.window = MainWindow()
self.window.show()

Expand Down
3 changes: 2 additions & 1 deletion buzz/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@


class Settings:
settings = QSettings(APP_NAME)
def __init__(self):
self.settings = QSettings(APP_NAME)

class Key(enum.Enum):
RECORDING_TRANSCRIBER_TASK = 'recording-transcriber/task'
Expand Down
2 changes: 1 addition & 1 deletion buzz/transcriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class TranscriptionOptions:
word_level_timings: bool = False
temperature: Tuple[float, ...] = DEFAULT_WHISPER_TEMPERATURE
initial_prompt: str = ''
openai_access_token: Optional[str] = None
openai_access_token: str = ''


@dataclass()
Expand Down
8 changes: 1 addition & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

from appdirs import user_log_dir

from buzz.__version__ import VERSION
from buzz.cli import parse_command_line, CommandLineError
from buzz.settings.settings import APP_NAME
from buzz.cli import parse_command_line

# Check for segfaults if not running in frozen mode
if getattr(sys, 'frozen', False) is False:
Expand Down Expand Up @@ -54,9 +52,5 @@
from buzz.gui import Application

app = Application()
app.setApplicationName(APP_NAME)
app.setApplicationVersion(VERSION)

parse_command_line(app)

sys.exit(app.exec())

0 comments on commit a9ad52d

Please sign in to comment.