diff --git a/Makefile b/Makefile index 6d2ce1eb7..fa401fe35 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ clean: rm -rf whisper.cpp/build || true rm -rf dist/* || true -COVERAGE_THRESHOLD := 80 +COVERAGE_THRESHOLD := 75 test: buzz/whisper_cpp.py translation_mo pytest -s -vv --cov=buzz --cov-report=xml --cov-report=html --benchmark-skip --cov-fail-under=${COVERAGE_THRESHOLD} diff --git a/README.md b/README.md index 5573c9b6b..b3818576f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ OpenAI's [Whisper](https://github.com/openai/whisper). **PyPI**: +Install [ffmpeg](https://www.ffmpeg.org/download.html) + +Install Buzz ```shell pip install buzz-captions python -m buzz diff --git a/buzz/model_loader.py b/buzz/model_loader.py index 6a9aed69c..163d39abd 100644 --- a/buzz/model_loader.py +++ b/buzz/model_loader.py @@ -9,6 +9,7 @@ import sys import tempfile import warnings +import platform from dataclasses import dataclass from typing import Optional, List @@ -88,6 +89,13 @@ def is_available(self): (self == ModelType.WHISPER_CPP and not LOADED_WHISPER_CPP_BINARY) ): return False + elif ( + # Hide Faster Whisper option on macOS x86_64 + # See: https://github.com/SYSTRAN/faster-whisper/issues/541 + (self == ModelType.FASTER_WHISPER + and platform.system() == "Darwin" and platform.machine() == "x86_64") + ): + return False return True def is_manually_downloadable(self): diff --git a/tests/transcriber/whisper_file_transcriber_test.py b/tests/transcriber/whisper_file_transcriber_test.py index 56f7da94d..0bc606dea 100644 --- a/tests/transcriber/whisper_file_transcriber_test.py +++ b/tests/transcriber/whisper_file_transcriber_test.py @@ -171,7 +171,7 @@ def test_default_output_file_with_date( whisper_model_size=WhisperModelSize.TINY, ), marks=pytest.mark.skipif( - platform.system() == "Darwin", + platform.system() == "Darwin" and platform.machine() == "x86_64", reason="Error with libiomp5 already initialized on GH action runner: https://github.com/chidiwilliams/buzz/actions/runs/4657331262/jobs/8241832087", ), ), diff --git a/tests/widgets/model_type_combo_box_test.py b/tests/widgets/model_type_combo_box_test.py index 1dcd877bb..39babb63e 100644 --- a/tests/widgets/model_type_combo_box_test.py +++ b/tests/widgets/model_type_combo_box_test.py @@ -1,4 +1,4 @@ -import sys +import platform import pytest @@ -16,6 +16,12 @@ class TestModelTypeComboBox: "Hugging Face", "Faster Whisper", "OpenAI Whisper API", + # Faster Whisper is not available on macOS x86_64 + ] if not (platform.system() == "Darwin" and platform.machine() == "x86_64") else [ + "Whisper", + "Whisper.cpp", + "Hugging Face", + "OpenAI Whisper API", ], ), ],