mirror of
https://github.com/QuentinFuxa/WhisperLiveKit.git
synced 2026-04-21 05:33:06 +00:00
Update package setup and exports
This commit is contained in:
@@ -35,7 +35,7 @@ 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"]
|
||||
sentence_tokenizer = ["mosestokenizer", "wtpsplit"]
|
||||
mlx-whisper = [
|
||||
@@ -52,6 +52,7 @@ voxtral-hf = [
|
||||
"mistral-common[audio]",
|
||||
"accelerate>=0.12",
|
||||
]
|
||||
listen = ["sounddevice>=0.4.6"]
|
||||
cpu = ["torch>=2.0.0", "torchaudio>=2.0.0"]
|
||||
cu129 = [
|
||||
"torch>=2.0.0",
|
||||
@@ -117,7 +118,18 @@ Homepage = "https://github.com/QuentinFuxa/WhisperLiveKit"
|
||||
|
||||
[project.scripts]
|
||||
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]
|
||||
packages = [
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
from .audio_processor import AudioProcessor
|
||||
from .config import WhisperLiveKitConfig
|
||||
from .core import TranscriptionEngine
|
||||
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
|
||||
|
||||
__all__ = [
|
||||
"WhisperLiveKitConfig",
|
||||
"TranscriptionEngine",
|
||||
"AudioProcessor",
|
||||
"parse_args",
|
||||
"transcribe_audio",
|
||||
"TranscriptionResult",
|
||||
"TestHarness",
|
||||
"TestState",
|
||||
"get_web_interface_html",
|
||||
"get_inline_ui_html",
|
||||
"download_simulstreaming_backend",
|
||||
]
|
||||
|
||||
@@ -11,7 +11,7 @@ def load_file(warmup_file=None, timeout=5):
|
||||
import librosa
|
||||
|
||||
if warmup_file == "":
|
||||
logger.info(f"Skipping warmup.")
|
||||
logger.info("Skipping warmup.")
|
||||
return None
|
||||
|
||||
# Download JFK sample if not already present
|
||||
@@ -48,5 +48,9 @@ def warmup_asr(asr, warmup_file=None, timeout=5):
|
||||
if audio is None:
|
||||
logger.warning("Warmup file unavailable. Skipping ASR warmup.")
|
||||
return
|
||||
asr.transcribe(audio)
|
||||
logger.info("ASR model is warmed up.")
|
||||
try:
|
||||
asr.transcribe(audio)
|
||||
except Exception as e:
|
||||
logger.warning("Warmup transcription failed: %s", e)
|
||||
return
|
||||
logger.info("ASR model is warmed up.")
|
||||
|
||||
Reference in New Issue
Block a user