mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 00:55:14 -07:00
Refactor TTS provider management and enhance documentation
- Renamed `bundled-mlx` to `apple-mlx` for clarity in provider types. - Updated the ProviderSettings component to reflect the new provider naming. - Improved logging for provider startup and error handling in the backend. - Added scripts for building and installing PyTorch CPU and CUDA providers locally. - Enhanced the documentation to include details on TTS provider architecture and development setup.
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
"""
|
||||
Build PyTorch CPU provider and install to local provider directory.
|
||||
"""
|
||||
|
||||
import platform
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
from build import build_provider
|
||||
|
||||
|
||||
def get_providers_dir() -> Path:
|
||||
"""Get the directory where providers are stored."""
|
||||
system = platform.system()
|
||||
|
||||
if system == "Windows":
|
||||
appdata = Path.home() / "AppData" / "Roaming"
|
||||
elif system == "Darwin":
|
||||
appdata = Path.home() / "Library" / "Application Support"
|
||||
else: # Linux
|
||||
appdata = Path.home() / ".local" / "share"
|
||||
|
||||
providers_dir = appdata / "voicebox" / "providers"
|
||||
providers_dir.mkdir(parents=True, exist_ok=True)
|
||||
return providers_dir
|
||||
|
||||
|
||||
def main():
|
||||
"""Build and install provider."""
|
||||
provider_dir = Path(__file__).parent
|
||||
|
||||
# Build the provider
|
||||
print("Building PyTorch CPU provider...")
|
||||
build_provider()
|
||||
|
||||
# Determine binary name
|
||||
binary_name = "tts-provider-pytorch-cpu"
|
||||
if platform.system() == "Windows":
|
||||
binary_name += ".exe"
|
||||
|
||||
# Source and destination paths
|
||||
source = provider_dir / "dist" / binary_name
|
||||
destination = get_providers_dir() / binary_name
|
||||
|
||||
# Copy to provider directory
|
||||
print(f"Installing to {destination}...")
|
||||
shutil.copy2(source, destination)
|
||||
|
||||
# Make executable on Unix systems
|
||||
if platform.system() != "Windows":
|
||||
destination.chmod(0o755)
|
||||
|
||||
print(f"✓ Provider installed successfully to {destination}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user