Skip to content

Commit

Permalink
Adding note on ffmpeg + fix for faster whisper on macOS (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus committed Aug 10, 2024
1 parent ecb85ae commit a71ec85
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions buzz/model_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sys
import tempfile
import warnings
import platform
from dataclasses import dataclass
from typing import Optional, List

Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/transcriber/whisper_file_transcriber_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
),
Expand Down
8 changes: 7 additions & 1 deletion tests/widgets/model_type_combo_box_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys
import platform

import pytest

Expand All @@ -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",
],
),
],
Expand Down

0 comments on commit a71ec85

Please sign in to comment.