From 942064912a3bdd6fec0e5517773b3bb88e51234a Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Sat, 31 Jan 2026 20:18:27 -0800 Subject: [PATCH] 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. --- backend/main.py | 14 ++++++++++++-- backend/providers/base.py | 2 +- backend/providers/bundled.py | 6 ++++-- backend/providers/local.py | 5 ++++- bun.lock | 11 +++++++---- tauri/src-tauri/Cargo.lock | 2 +- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/backend/main.py b/backend/main.py index 3bd4b7e6..f6d00a1f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1362,7 +1362,12 @@ async def get_model_status(): if asyncio.iscoroutinefunction(check_func): loaded = await check_func() else: - loaded = check_func() + result = check_func() + # Handle lambdas that return coroutines + if asyncio.iscoroutine(result): + loaded = await result + else: + loaded = result except Exception: loaded = False @@ -1389,7 +1394,12 @@ async def get_model_status(): if asyncio.iscoroutinefunction(check_func): loaded = await check_func() else: - loaded = check_func() + result = check_func() + # Handle lambdas that return coroutines + if asyncio.iscoroutine(result): + loaded = await result + else: + loaded = result except Exception: loaded = False diff --git a/backend/providers/base.py b/backend/providers/base.py index f3a6b4c2..50b05ce0 100644 --- a/backend/providers/base.py +++ b/backend/providers/base.py @@ -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.""" ... diff --git a/backend/providers/bundled.py b/backend/providers/bundled.py index b4a5e2ca..9c37e23c 100644 --- a/backend/providers/bundled.py +++ b/backend/providers/bundled.py @@ -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.""" diff --git a/backend/providers/local.py b/backend/providers/local.py index 004e6fc3..3ea4d75b 100644 --- a/backend/providers/local.py +++ b/backend/providers/local.py @@ -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.""" diff --git a/bun.lock b/bun.lock index 9e08a825..3879020e 100644 --- a/bun.lock +++ b/bun.lock @@ -13,7 +13,7 @@ }, "app": { "name": "@voicebox/app", - "version": "0.1.11", + "version": "0.1.12", "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", @@ -26,6 +26,7 @@ "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-popover": "^1.1.1", "@radix-ui/react-progress": "^1.1.0", + "@radix-ui/react-radio-group": "^1.2.0", "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-separator": "^1.1.0", @@ -68,7 +69,7 @@ }, "landing": { "name": "@voicebox/landing", - "version": "0.1.11", + "version": "0.1.12", "dependencies": { "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", @@ -93,7 +94,7 @@ }, "tauri": { "name": "@voicebox/tauri", - "version": "0.1.11", + "version": "0.1.12", "dependencies": { "@tauri-apps/api": "^2.0.0", "@tauri-apps/plugin-dialog": "^2.0.0", @@ -116,7 +117,7 @@ }, "web": { "name": "@voicebox/web", - "version": "0.1.11", + "version": "0.1.12", "dependencies": { "@tanstack/react-query": "^5.0.0", "react": "^18.3.0", @@ -407,6 +408,8 @@ "@radix-ui/react-progress": ["@radix-ui/react-progress@1.1.8", "", { "dependencies": { "@radix-ui/react-context": "1.1.3", "@radix-ui/react-primitive": "2.1.4" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-+gISHcSPUJ7ktBy9RnTqbdKW78bcGke3t6taawyZ71pio1JewwGSJizycs7rLhGTvMJYCQB1DBK4KQsxs7U8dA=="], + "@radix-ui/react-radio-group": ["@radix-ui/react-radio-group@1.3.8", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-use-size": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-VBKYIYImA5zsxACdisNQ3BjCBfmbGH3kQlnFVqlWU4tXwjy7cGX8ta80BcrO+WJXIn5iBylEH3K6ZTlee//lgQ=="], + "@radix-ui/react-roving-focus": ["@radix-ui/react-roving-focus@1.1.11", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA=="], "@radix-ui/react-scroll-area": ["@radix-ui/react-scroll-area@1.2.10", "", { "dependencies": { "@radix-ui/number": "1.1.1", "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-tAXIa1g3sM5CGpVT0uIbUx/U3Gs5N8T52IICuCtObaos1S8fzsrPXG5WObkQN3S6NVl6wKgPhAIiBGbWnvc97A=="], diff --git a/tauri/src-tauri/Cargo.lock b/tauri/src-tauri/Cargo.lock index 4528097c..35b15188 100644 --- a/tauri/src-tauri/Cargo.lock +++ b/tauri/src-tauri/Cargo.lock @@ -5041,7 +5041,7 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "voicebox" -version = "0.1.11" +version = "0.1.12" dependencies = [ "base64 0.22.1", "core-foundation-sys",