mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-26 13:45:16 -07:00
Update TTS provider methods and dependencies
- Renamed `load_model` to `load_model_async` in TTS provider classes for clarity and consistency. - Added compatibility alias for `load_model` to maintain existing functionality. - Enhanced `get_model_status` to handle both synchronous and asynchronous check functions. - Updated version numbers in `bun.lock` and `Cargo.lock` to 0.1.12, reflecting recent changes.
This commit is contained in:
@@ -72,7 +72,7 @@ class TTSProvider(Protocol):
|
||||
"""
|
||||
...
|
||||
|
||||
async def load_model(self, model_size: str) -> None:
|
||||
async def load_model_async(self, model_size: str) -> None:
|
||||
"""Load TTS model."""
|
||||
...
|
||||
|
||||
|
||||
@@ -55,14 +55,16 @@ class BundledProvider:
|
||||
backend = self._get_backend()
|
||||
return await backend.combine_voice_prompts(audio_paths, reference_texts)
|
||||
|
||||
async def load_model(self, model_size: str) -> None:
|
||||
async def load_model_async(self, model_size: str) -> None:
|
||||
"""Load TTS model."""
|
||||
backend = self._get_backend()
|
||||
# Backends use load_model_async, but Protocol defines load_model
|
||||
if hasattr(backend, 'load_model_async'):
|
||||
await backend.load_model_async(model_size)
|
||||
else:
|
||||
await backend.load_model(model_size)
|
||||
|
||||
# Alias for compatibility
|
||||
load_model = load_model_async
|
||||
|
||||
def unload_model(self) -> None:
|
||||
"""Unload model to free memory."""
|
||||
|
||||
@@ -115,11 +115,14 @@ class LocalProvider:
|
||||
|
||||
return mixed, combined_text
|
||||
|
||||
async def load_model(self, model_size: str) -> None:
|
||||
async def load_model_async(self, model_size: str) -> None:
|
||||
"""Load TTS model."""
|
||||
# Track the requested model size - the provider server will load it
|
||||
# when generate() is called with this size
|
||||
self._current_model_size = model_size
|
||||
|
||||
# Alias for compatibility
|
||||
load_model = load_model_async
|
||||
|
||||
def unload_model(self) -> None:
|
||||
"""Unload model to free memory."""
|
||||
|
||||
Reference in New Issue
Block a user