Skip to content

Commit

Permalink
fix: execstack
Browse files Browse the repository at this point in the history
  • Loading branch information
chidiwilliams committed Jan 4, 2024
1 parent e14003b commit 9dae50c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion buzz/transcriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import numpy as np
import openai
import stable_whisper
import tqdm
from PyQt6.QtCore import QObject, pyqtSignal, pyqtSlot
from dataclasses_json import dataclass_json, config, Exclude
Expand All @@ -32,6 +31,7 @@
if sys.platform != "linux":
import faster_whisper
import whisper
import stable_whisper
from whisper import tokenizer

# Catch exception from whisper.dll not getting loaded.
Expand Down
15 changes: 12 additions & 3 deletions buzz/widgets/model_type_combo_box.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from typing import Optional, List

from PyQt6.QtCore import pyqtSignal
Expand All @@ -22,9 +23,17 @@ def __init__(
model_types = [model_type for model_type in ModelType]

for model_type in model_types:
# Hide Whisper.cpp option is whisper.dll did not load correctly.
# See: https://github.com/chidiwilliams/buzz/issues/274, https://github.com/chidiwilliams/buzz/issues/197
if model_type == ModelType.WHISPER_CPP and LOADED_WHISPER_DLL is False:
if (
# Hide Whisper.cpp option if whisper.dll did not load correctly.
# See: https://github.com/chidiwilliams/buzz/issues/274,
# https://github.com/chidiwilliams/buzz/issues/197
model_type == ModelType.WHISPER_CPP and LOADED_WHISPER_DLL is False
) or (
# Disable Whisper and Faster Whisper options
# on Linux due to execstack errors on Snap
model_type in (ModelType.WHISPER, ModelType.FASTER_WHISPER)
and sys.platform == "Linux"
):
continue
self.addItem(model_type.value)

Expand Down

0 comments on commit 9dae50c

Please sign in to comment.