Update package setup and exports
This commit is contained in:
parent
e30f9a2573
commit
cd8df8e1aa
3 changed files with 29 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
test = ["pytest>=7.0", "pytest-asyncio>=0.21"]
|
test = ["pytest>=7.0", "pytest-asyncio>=0.21", "datasets>=2.14", "librosa"]
|
||||||
translation = ["nllw"]
|
translation = ["nllw"]
|
||||||
sentence_tokenizer = ["mosestokenizer", "wtpsplit"]
|
sentence_tokenizer = ["mosestokenizer", "wtpsplit"]
|
||||||
mlx-whisper = [
|
mlx-whisper = [
|
||||||
|
|
@ -52,6 +52,7 @@ voxtral-hf = [
|
||||||
"mistral-common[audio]",
|
"mistral-common[audio]",
|
||||||
"accelerate>=0.12",
|
"accelerate>=0.12",
|
||||||
]
|
]
|
||||||
|
listen = ["sounddevice>=0.4.6"]
|
||||||
cpu = ["torch>=2.0.0", "torchaudio>=2.0.0"]
|
cpu = ["torch>=2.0.0", "torchaudio>=2.0.0"]
|
||||||
cu129 = [
|
cu129 = [
|
||||||
"torch>=2.0.0",
|
"torch>=2.0.0",
|
||||||
|
|
@ -117,7 +118,18 @@ Homepage = "https://github.com/QuentinFuxa/WhisperLiveKit"
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
whisperlivekit-server = "whisperlivekit.basic_server:main"
|
whisperlivekit-server = "whisperlivekit.basic_server:main"
|
||||||
wlk = "whisperlivekit.basic_server:main"
|
wlk = "whisperlivekit.cli:main"
|
||||||
|
wlk-test = "whisperlivekit.test_client:main"
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
target-version = "py311"
|
||||||
|
line-length = 120
|
||||||
|
exclude = [".git", "__pycache__", "build", "dist", ".eggs", ".claude", "scripts", "run_benchmark.py"]
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
select = ["E", "F", "W", "I"]
|
||||||
|
ignore = ["E501", "E741"]
|
||||||
|
per-file-ignores = {"whisperlivekit/whisper/*" = ["F401", "F841", "E731", "W"], "whisperlivekit/simul_whisper/mlx/*" = ["F401", "E731", "W"], "whisperlivekit/simul_whisper/mlx_encoder.py" = ["E731", "F821"], "whisperlivekit/silero_vad_iterator.py" = ["F401"]}
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
packages = [
|
packages = [
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,20 @@
|
||||||
from .audio_processor import AudioProcessor
|
from .audio_processor import AudioProcessor
|
||||||
|
from .config import WhisperLiveKitConfig
|
||||||
from .core import TranscriptionEngine
|
from .core import TranscriptionEngine
|
||||||
from .parse_args import parse_args
|
from .parse_args import parse_args
|
||||||
|
from .test_client import TranscriptionResult, transcribe_audio
|
||||||
|
from .test_harness import TestHarness, TestState
|
||||||
from .web.web_interface import get_inline_ui_html, get_web_interface_html
|
from .web.web_interface import get_inline_ui_html, get_web_interface_html
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
"WhisperLiveKitConfig",
|
||||||
"TranscriptionEngine",
|
"TranscriptionEngine",
|
||||||
"AudioProcessor",
|
"AudioProcessor",
|
||||||
"parse_args",
|
"parse_args",
|
||||||
|
"transcribe_audio",
|
||||||
|
"TranscriptionResult",
|
||||||
|
"TestHarness",
|
||||||
|
"TestState",
|
||||||
"get_web_interface_html",
|
"get_web_interface_html",
|
||||||
"get_inline_ui_html",
|
"get_inline_ui_html",
|
||||||
"download_simulstreaming_backend",
|
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ def load_file(warmup_file=None, timeout=5):
|
||||||
import librosa
|
import librosa
|
||||||
|
|
||||||
if warmup_file == "":
|
if warmup_file == "":
|
||||||
logger.info(f"Skipping warmup.")
|
logger.info("Skipping warmup.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Download JFK sample if not already present
|
# Download JFK sample if not already present
|
||||||
|
|
@ -48,5 +48,9 @@ def warmup_asr(asr, warmup_file=None, timeout=5):
|
||||||
if audio is None:
|
if audio is None:
|
||||||
logger.warning("Warmup file unavailable. Skipping ASR warmup.")
|
logger.warning("Warmup file unavailable. Skipping ASR warmup.")
|
||||||
return
|
return
|
||||||
asr.transcribe(audio)
|
try:
|
||||||
|
asr.transcribe(audio)
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning("Warmup transcription failed: %s", e)
|
||||||
|
return
|
||||||
logger.info("ASR model is warmed up.")
|
logger.info("ASR model is warmed up.")
|
||||||
Loading…
Reference in a new issue