mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-26 13:45:16 -07:00
Enhance ProviderSettings component for platform-specific functionality
- Added platform detection for macOS and Windows to improve user experience. - Updated UI to conditionally disable options and provide clearer guidance based on installed providers. - Refactored button states and labels for PyTorch CUDA and CPU to reflect availability and download status accurately.
This commit is contained in:
@@ -220,16 +220,11 @@ class ProviderManager:
|
||||
installed.append("pytorch-cpu")
|
||||
# Linux: no bundled provider - users must download
|
||||
|
||||
# Check for downloaded providers (Phase 2)
|
||||
providers_dir = _get_providers_dir()
|
||||
if providers_dir.exists():
|
||||
for provider_file in providers_dir.glob("tts-provider-*"):
|
||||
if provider_file.is_file() and provider_file.stat().st_size > 0:
|
||||
name = provider_file.name
|
||||
if "pytorch-cpu" in name:
|
||||
installed.append("pytorch-cpu")
|
||||
elif "pytorch-cuda" in name:
|
||||
installed.append("pytorch-cuda")
|
||||
# Check for downloaded providers by checking if binary path exists
|
||||
for provider_type in ["pytorch-cpu", "pytorch-cuda"]:
|
||||
binary_path = get_provider_binary_path(provider_type)
|
||||
if binary_path and binary_path.exists() and provider_type not in installed:
|
||||
installed.append(provider_type)
|
||||
|
||||
return installed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user