mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-15 07:05:48 +01:00
21 lines
545 B
Python
21 lines
545 B
Python
import platform
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
from buzz.transformers_whisper import load_model
|
|
from tests.audio import test_audio_path
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
sys.platform == "linux" or platform.system() == "Darwin",
|
|
reason="Not supported on Linux",
|
|
)
|
|
class TestTransformersWhisper:
|
|
def test_should_transcribe(self):
|
|
model = load_model("openai/whisper-tiny")
|
|
result = model.transcribe(
|
|
audio=test_audio_path, language="fr", task="transcribe"
|
|
)
|
|
|
|
assert "Bienvenue dans Passe" in result["text"]
|