From ce4269ffa545cd9b908cb9df916718fcd9784a7f Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Sat, 31 Jan 2026 03:45:41 -0800 Subject: [PATCH] Refactor build scripts and update release workflow - Commented out the PyTorch CPU configuration in the release workflow for Ubuntu 22.04. - Updated TTS provider documentation to clarify options for Windows and Linux users. - Enhanced build scripts for both CPU and CUDA providers by excluding large unused modules to reduce binary size. --- .github/workflows/release.yml | 12 ++++++------ providers/pytorch-cpu/build.py | 18 ++++++++++++++++++ providers/pytorch-cuda/build.py | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07f5c98d..ebf84c01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,9 +28,9 @@ jobs: provider: "pytorch-cuda" python-version: "3.12" # PyTorch CPU provider (Linux) - - platform: "ubuntu-22.04" - provider: "pytorch-cpu" - python-version: "3.12" + # - platform: "ubuntu-22.04" + # provider: "pytorch-cpu" + # python-version: "3.12" # PyTorch CUDA provider (Linux) - large binary, uploaded to R2 - platform: "ubuntu-22.04" provider: "pytorch-cuda" @@ -268,10 +268,10 @@ jobs: - **Windows**: Download the `.msi` installer - requires downloading a TTS provider on first use - **Linux**: Download the `.AppImage` or `.deb` package - requires downloading a TTS provider on first use - ### TTS Providers (Windows/Linux) + ### TTS Providers Windows and Linux users will be prompted to download a TTS provider on first launch: - - **PyTorch CPU** (~300MB) - Works on any system - - **PyTorch CUDA** (~2.4GB) - 4-5x faster on NVIDIA GPUs + - **Windows**: PyTorch CPU (~300MB) or PyTorch CUDA (~2.4GB for NVIDIA GPUs) + - **Linux**: PyTorch CUDA (~2.4GB) - requires NVIDIA GPU The app includes automatic updates - future updates will be installed automatically. releaseDraft: true diff --git a/providers/pytorch-cpu/build.py b/providers/pytorch-cpu/build.py index 8894edcb..6596c266 100644 --- a/providers/pytorch-cpu/build.py +++ b/providers/pytorch-cpu/build.py @@ -56,6 +56,24 @@ def build_provider(): '--hidden-import', 'librosa', ]) + # Exclude large unused modules to reduce binary size + args.extend([ + '--exclude-module', 'torch.utils.tensorboard', + '--exclude-module', 'tensorboard', + '--exclude-module', 'triton', + '--exclude-module', 'torch.distributed', + '--exclude-module', 'torch._dynamo', + '--exclude-module', 'torch._inductor', + '--exclude-module', 'torch.testing', + '--exclude-module', 'torch.utils.benchmark', + '--exclude-module', 'IPython', + '--exclude-module', 'matplotlib', + '--exclude-module', 'PIL', + '--exclude-module', 'cv2', + '--exclude-module', 'torchvision', + '--exclude-module', 'torchaudio', + ]) + args.extend([ '--noconfirm', '--clean', diff --git a/providers/pytorch-cuda/build.py b/providers/pytorch-cuda/build.py index 8ff67334..565885b2 100644 --- a/providers/pytorch-cuda/build.py +++ b/providers/pytorch-cuda/build.py @@ -58,6 +58,24 @@ def build_provider(): '--hidden-import', 'librosa', ]) + # Exclude large unused modules to reduce binary size + args.extend([ + '--exclude-module', 'torch.utils.tensorboard', + '--exclude-module', 'tensorboard', + '--exclude-module', 'triton', + '--exclude-module', 'torch.distributed', + '--exclude-module', 'torch._dynamo', + '--exclude-module', 'torch._inductor', + '--exclude-module', 'torch.testing', + '--exclude-module', 'torch.utils.benchmark', + '--exclude-module', 'IPython', + '--exclude-module', 'matplotlib', + '--exclude-module', 'PIL', + '--exclude-module', 'cv2', + '--exclude-module', 'torchvision', + '--exclude-module', 'torchaudio', + ]) + args.extend([ '--noconfirm', '--clean',