Adding note on ffmpeg + fix for faster whisper on macOS (#882)

This commit is contained in:
Raivis Dejus 2024-08-10 22:07:37 +03:00 committed by GitHub
commit a71ec85195
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 3 deletions

View file

@ -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}

View file

@ -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

View file

@ -9,6 +9,7 @@ import subprocess
import sys
import tempfile
import warnings
import platform
from dataclasses import dataclass
from typing import Optional, List
@ -88,6 +89,13 @@ class ModelType(enum.Enum):
(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):

View file

@ -171,7 +171,7 @@ class TestWhisperFileTranscriber:
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",
),
),

View file

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