diff --git a/pyproject.toml b/pyproject.toml index d191f88..75e9fca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,10 +29,19 @@ classifiers = [ dependencies = [ "aiohttp>=3.8.4", "aiofiles>=23.1.0", + "ctranslate2>=3.18.0", + "faster-whisper @ git+https://github.com/Wordcab/faster-whisper@master", "ffmpeg-python>=0.2.0", + "librosa>=0.9.0", "loguru>=0.6.0", + "numpy==1.23.1", + "onnxruntime>=1.15.0", "pydantic>=1.10.9", "python-dotenv>=1.0.0", + "tensorshare>=0.1.1", + "torch>=2.0.0", + "torchaudio>=2.0.1", + "wget>=3.2.0", "yt-dlp>=2023.3.4", ] @@ -48,17 +57,6 @@ path = "src/wordcab_transcribe/__init__.py" allow-direct-references = true [project.optional-dependencies] -inference = [ - "ctranslate2>=3.18.0", - "faster-whisper @ git+https://github.com/Wordcab/faster-whisper@master", - "librosa>=0.9.0", - "numpy==1.23.1", - "onnxruntime>=1.15.0", - "tensorshare>=0.1.1", - "torch>=2.0.0", - "torchaudio>=2.0.1", - "wget>=3.2.0", -] runtime = [ "argon2-cffi>=21.3.0", "fastapi>=0.96.0", @@ -68,7 +66,6 @@ runtime = [ "svix>=0.85.1", "uvicorn>=0.21.1", "websockets>=11.0.3", - "wordcab_transcribe[inference]", ] quality = [ "black>=22.10.0", @@ -80,9 +77,8 @@ tests = [ "pytest>=7.4", "pytest-asyncio>=0.21.1", "pytest-cov>=4.1", - "wordcab_transcribe[inference]", ] -dev = ["wordcab_transcribe[quality,inference,runtime,tests]"] +dev = ["wordcab_transcribe[quality,runtime,tests]"] [tool.hatch.envs.runtime] features = [ diff --git a/tests/test_models.py b/tests/test_models.py index e1447b0..fe6bdad 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -20,6 +20,7 @@ """Test the models for requests and responses.""" import pytest +from faster_whisper.transcribe import Word from wordcab_transcribe.models import ( AudioRequest, @@ -33,7 +34,6 @@ ProcessTimes, Timestamps, Utterance, - Word, YouTubeResponse, ) @@ -59,20 +59,6 @@ def test_timestamps() -> None: assert Timestamps.hour_minute_second == "hms" -def test_word() -> None: - """Test the Word model.""" - word = Word( - word="test", - start=0.0, - end=1.0, - score=0.9, - ) - assert word.word == "test" - assert word.start == 0.0 - assert word.end == 1.0 - assert word.score == 0.9 - - def test_utterance() -> None: """Test the Utterance model.""" utterance = Utterance( @@ -85,25 +71,25 @@ def test_utterance() -> None: word="This", start=0.0, end=1.0, - score=0.9, + probability=0.9, ), Word( word="is", start=1.0, end=2.0, - score=0.75, + probability=0.75, ), Word( word="a", start=2.0, end=3.0, - score=0.8, + probability=0.8, ), Word( word="test.", start=3.0, end=4.0, - score=0.85, + probability=0.85, ), ], ) @@ -117,25 +103,25 @@ def test_utterance() -> None: word="This", start=0.0, end=1.0, - score=0.9, + probability=0.9, ), Word( word="is", start=1.0, end=2.0, - score=0.75, + probability=0.75, ), Word( word="a", start=2.0, end=3.0, - score=0.8, + probability=0.8, ), Word( word="test.", start=3.0, end=4.0, - score=0.85, + probability=0.85, ), ] assert isinstance(utterance.words[0], Word)