From 595747c3d01f42b4af15ba643c7657a59b7ff67f Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Sun, 1 Feb 2026 02:29:40 -0800 Subject: [PATCH] Refactor provider health status and update build configurations - Updated the `ProviderSettings` component to log the current active provider. - Changed the provider health status to use specific names for MLX and PyTorch backends. - Removed unnecessary exclusions from the build scripts for both PyTorch CPU and CUDA providers. - Ensured consistency in the `.spec` files for PyTorch providers by aligning exclusion lists. --- .../ServerSettings/ProviderSettings.tsx | 3 ++- backend/providers/bundled.py | 11 +++++++---- providers/pytorch-cpu/build.py | 1 - .../pytorch-cpu/tts-provider-pytorch-cpu.spec | 2 +- providers/pytorch-cuda/build.py | 1 - .../tts-provider-pytorch-cuda.spec | 2 +- tauri/src-tauri/gen/Assets.car | Bin 3847048 -> 3847048 bytes 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/components/ServerSettings/ProviderSettings.tsx b/app/src/components/ServerSettings/ProviderSettings.tsx index b0bc5c50..41f820df 100644 --- a/app/src/components/ServerSettings/ProviderSettings.tsx +++ b/app/src/components/ServerSettings/ProviderSettings.tsx @@ -172,7 +172,8 @@ export function ProviderSettings() { const installedProviders = providersData?.installed || []; // Determine current active provider - const currentProvider = activeProvider?.provider || 'auto'; + const currentProvider = activeProvider?.provider; + console.log('currentProvider', currentProvider); const selectedProvider = currentProvider as ProviderType; return ( diff --git a/backend/providers/bundled.py b/backend/providers/bundled.py index 9c37e23c..bb34cd57 100644 --- a/backend/providers/bundled.py +++ b/backend/providers/bundled.py @@ -85,22 +85,25 @@ class BundledProvider: """Get provider health status.""" backend = self._get_backend() backend_type = get_backend_type() - + model_size = None if backend.is_loaded(): # Try to get current model size from backend if hasattr(backend, '_current_model_size') and backend._current_model_size: model_size = backend._current_model_size - + device = None if backend_type == "mlx": device = "metal" elif hasattr(backend, 'device'): device = backend.device - + + # Use apple-mlx for MLX backend, pytorch-cpu for PyTorch + provider_name = "apple-mlx" if backend_type == "mlx" else "pytorch-cpu" + return ProviderHealth( status="healthy", - provider=f"bundled-{backend_type}", + provider=provider_name, version=None, # Provider versioning not implemented yet model=model_size, device=device, diff --git a/providers/pytorch-cpu/build.py b/providers/pytorch-cpu/build.py index b70100c5..5d714d9c 100644 --- a/providers/pytorch-cpu/build.py +++ b/providers/pytorch-cpu/build.py @@ -63,7 +63,6 @@ def build_provider(): '--exclude-module', 'triton', '--exclude-module', 'torch._dynamo', '--exclude-module', 'torch._inductor', - '--exclude-module', 'torch.testing', '--exclude-module', 'torch.utils.benchmark', '--exclude-module', 'IPython', '--exclude-module', 'matplotlib', diff --git a/providers/pytorch-cpu/tts-provider-pytorch-cpu.spec b/providers/pytorch-cpu/tts-provider-pytorch-cpu.spec index e4208043..8ab78036 100644 --- a/providers/pytorch-cpu/tts-provider-pytorch-cpu.spec +++ b/providers/pytorch-cpu/tts-provider-pytorch-cpu.spec @@ -20,7 +20,7 @@ a = Analysis( hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=['torch.utils.tensorboard', 'tensorboard', 'triton', 'torch._dynamo', 'torch._inductor', 'torch.testing', 'torch.utils.benchmark', 'IPython', 'matplotlib', 'PIL', 'cv2', 'torchvision', 'torchaudio'], + excludes=['torch.utils.tensorboard', 'tensorboard', 'triton', 'torch._dynamo', 'torch._inductor', 'torch.utils.benchmark', 'IPython', 'matplotlib', 'PIL', 'cv2', 'torchvision', 'torchaudio'], noarchive=False, optimize=0, ) diff --git a/providers/pytorch-cuda/build.py b/providers/pytorch-cuda/build.py index 28a6fc8e..00630c3b 100644 --- a/providers/pytorch-cuda/build.py +++ b/providers/pytorch-cuda/build.py @@ -65,7 +65,6 @@ def build_provider(): '--exclude-module', 'triton', '--exclude-module', 'torch._dynamo', '--exclude-module', 'torch._inductor', - '--exclude-module', 'torch.testing', '--exclude-module', 'torch.utils.benchmark', '--exclude-module', 'IPython', '--exclude-module', 'matplotlib', diff --git a/providers/pytorch-cuda/tts-provider-pytorch-cuda.spec b/providers/pytorch-cuda/tts-provider-pytorch-cuda.spec index f8179e96..01230506 100644 --- a/providers/pytorch-cuda/tts-provider-pytorch-cuda.spec +++ b/providers/pytorch-cuda/tts-provider-pytorch-cuda.spec @@ -20,7 +20,7 @@ a = Analysis( hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=['torch.utils.tensorboard', 'tensorboard', 'triton', 'torch._dynamo', 'torch._inductor', 'torch.testing', 'torch.utils.benchmark', 'IPython', 'matplotlib', 'PIL', 'cv2', 'torchvision', 'torchaudio'], + excludes=['torch.utils.tensorboard', 'tensorboard', 'triton', 'torch._dynamo', 'torch._inductor', 'torch.utils.benchmark', 'IPython', 'matplotlib', 'PIL', 'cv2', 'torchvision', 'torchaudio'], noarchive=False, optimize=0, ) diff --git a/tauri/src-tauri/gen/Assets.car b/tauri/src-tauri/gen/Assets.car index f87bc4fb862e49d7e9477935436913a22ea535ea..6ed044ab061aef37a81f5257694180a702734d76 100644 GIT binary patch delta 858 zcmZwGJ5N+W6bJCTtjO|QR6xK*K*jfgnZ5I*xy&<^lzam_V`*VwVzHDGVy8WcjS0o2 z^c(OM?A#b*)Wp#GC#(%}lV46Ilbl!P?tT5%*n>|eYfF@pbb+;zt&FL z`)v4NN3ny?^6kNE)oJ`W`k;OfRbD5{c~B&5)+AU6WW6uRYi>o5LdBAik=jUNXCL=L zC7~s^di}-oXZx#*Z~C^^w+$GACR~AGxC$e6-?q{)>gc2b4-_L~D3&DokUSa1TsNbV z66XIpiYuAV>vZb9s`ai}Ido)JEctFqq`PGm%M!V+9!%b;`?0mqtV9e-2jmDWlvp8mWOdG@Ezc|^ zW0FOW7gi{h6HJ_UG~e6ZZow#w!8lC7BuqgYrr{b~hZ`^hvoHrY;Vj1jEW$15z!Kbs zWmth#xC3|L9<0HAcmNOK5j?JUx1XGzR#8WrLkgsMj3km(WVG|-lFZin6iZBaaVX)f zWPb22dWTz2fnXgrfB}atlpsLXhg+)tQL(_3GkAzyQ#umHb8a2x@<5E@ ze6YpE-tmS81GYZi*lfPyGesf4;1?J|{E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