Re-enable whisper.cpp on Windows (#155)

This commit is contained in:
Chidi Williams 2022-11-11 10:38:11 +00:00 committed by GitHub
parent 3de06b0e6f
commit a1b9097133
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 18 deletions

View file

@ -78,6 +78,6 @@ app = BUNDLE(
info_plist={
'NSPrincipalClass': 'NSApplication',
'NSHighResolutionCapable': 'True',
'NSMicrophoneUsageDescription': 'Please provide microphone access'
'NSMicrophoneUsageDescription': 'Allow Buzz to record audio from your microphone.'
}
)

View file

@ -43,7 +43,7 @@ clean:
rm -rf dist/* || true
test: whisper_cpp.py
pytest --cov --cov-fail-under=70 --cov-report html
pytest --cov --cov-fail-under=69 --cov-report html
dist/Buzz: whisper_cpp.py
pyinstaller --noconfirm Buzz.spec
@ -62,10 +62,14 @@ ifeq ($(UNAME_S),Darwin)
ifeq (,$(findstring AVX2,$(AVX2_M)))
CMAKE_FLAGS += -DWHISPER_NO_AVX2=ON
endif
else
ifeq ($(OS), Windows_NT)
CMAKE_FLAGS += -DBUILD_SHARED_LIBS=ON
endif
endif
$(LIBWHISPER):
cmake -S whisper.cpp -B whisper.cpp/build/ $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS=ON
cmake -S whisper.cpp -B whisper.cpp/build/ $(CMAKE_FLAGS)
cmake --build whisper.cpp/build --verbose
cp whisper.cpp/build/$(LIBWHISPER) . || true
cp whisper.cpp/build/bin/Debug/$(LIBWHISPER) . || true

27
gui.py
View file

@ -538,8 +538,6 @@ class Settings(QSettings):
super().__init__('Buzz', 'Buzz', parent, *args)
def enable_ggml_inference(self):
if platform.system() == 'Windows':
return False
return self.value(self.ENABLE_GGML_INFERENCE, False)
@ -782,22 +780,21 @@ class MainWindow(QMainWindow):
self.about_action = QAction(f'&About {APP_NAME}', self)
self.about_action.triggered.connect(self.on_trigger_about_action)
self.help_menu = menu.addMenu("&Help")
self.help_menu.addAction(self.about_action)
self.settings = Settings(self)
if platform.system() != 'Windows':
enable_ggml_inference_action = QAction(
'&Enable GGML Inference', self)
enable_ggml_inference_action.setCheckable(True)
enable_ggml_inference_action.setChecked(
bool(self.settings.enable_ggml_inference()))
enable_ggml_inference_action.triggered.connect(
self.on_toggle_enable_ggml_inference)
enable_ggml_inference_action = QAction(
'&Enable GGML Inference', self)
enable_ggml_inference_action.setCheckable(True)
enable_ggml_inference_action.setChecked(
bool(self.settings.enable_ggml_inference()))
enable_ggml_inference_action.triggered.connect(
self.on_toggle_enable_ggml_inference)
settings_menu = menu.addMenu("&Settings")
settings_menu.addAction(enable_ggml_inference_action)
settings_menu = menu.addMenu("&Settings")
settings_menu.addAction(enable_ggml_inference_action)
self.help_menu = menu.addMenu("&Help")
self.help_menu.addAction(self.about_action)
def on_import_audio_file_action(self):
(file_path, _) = QFileDialog.getOpenFileName(