mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 12:50:42 -07:00
- Added support for MLX backend on Apple Silicon, enabling optimized performance for TTS and STT tasks. - Updated release workflow to include MLX-specific dependencies and configurations for macOS platforms. - Refactored backend code to dynamically select between MLX and PyTorch based on the runtime environment. - Enhanced model loading and inference logic to accommodate backend-specific requirements, including updated model IDs and hidden imports. - Improved health check and model status reporting to reflect the active backend type. - Streamlined caching mechanisms to support both backend types, ensuring compatibility and performance.
23 lines
491 B
Python
23 lines
491 B
Python
"""
|
|
STT (Speech-to-Text) module - delegates to backend abstraction layer.
|
|
"""
|
|
|
|
from typing import Optional
|
|
from .backends import get_stt_backend, STTBackend
|
|
|
|
|
|
def get_whisper_model() -> STTBackend:
|
|
"""
|
|
Get STT backend instance (MLX or PyTorch based on platform).
|
|
|
|
Returns:
|
|
STT backend instance
|
|
"""
|
|
return get_stt_backend()
|
|
|
|
|
|
def unload_whisper_model():
|
|
"""Unload Whisper model to free memory."""
|
|
backend = get_stt_backend()
|
|
backend.unload_model()
|