Skip to content

Commit 9f89f67

Browse files
committed
Draft
1 parent fdf794e commit 9f89f67

File tree

218 files changed

+8843
-12268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+8843
-12268
lines changed

.github/build_windows_packages.ps1

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ $UVR5_URL = "$baseHF/uvr5_weights.zip"
3131
$NLTK_URL = "$baseHF/nltk_data.zip"
3232
$JTALK_URL = "$baseHF/open_jtalk_dic_utf_8-1.11.tar.gz"
3333

34-
$PYTHON_VERSION = "3.11.12"
35-
$PY_RELEASE_VERSION = "20250409"
34+
$PYTHON_VERSION = "3.10.18"
35+
$PY_RELEASE_VERSION = "20250902"
3636

3737
Write-Host "[INFO] Cleaning .git..."
3838
Remove-Item "$srcDir\.git" -Recurse -Force -ErrorAction SilentlyContinue
@@ -115,12 +115,17 @@ Remove-Item $ffDir.FullName -Recurse -Force
115115
Write-Host "[INFO] Installing PyTorch..."
116116
& ".\runtime\python.exe" -m ensurepip
117117
& ".\runtime\python.exe" -m pip install --upgrade pip --no-warn-script-location
118+
118119
switch ($cuda) {
119-
"cu124" {
120-
& ".\runtime\python.exe" -m pip install torch==2.6 torchaudio --index-url https://download.pytorch.org/whl/cu124 --no-warn-script-location
120+
"cu126" {
121+
& ".\runtime\python.exe" -m pip install psutil ninja packaging wheel "setuptools>=42" --no-warn-script-location
122+
& ".\runtime\python.exe" -m pip install torch --index-url https://download.pytorch.org/whl/cu126 --no-warn-script-location
123+
& ".\runtime\python.exe" -m pip install flash-attn -i https://xxxxrt666.github.io/PIP-Index/ --no-build-isolation
121124
}
122125
"cu128" {
123-
& ".\runtime\python.exe" -m pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu128 --no-warn-script-location
126+
& ".\runtime\python.exe" -m pip install psutil ninja packaging wheel "setuptools>=42" --no-warn-script-location
127+
& ".\runtime\python.exe" -m pip install torch --index-url https://download.pytorch.org/whl/cu128 --no-warn-script-location
128+
& ".\runtime\python.exe" -m pip install flash-attn -i https://xxxxrt666.github.io/PIP-Index/ --no-build-isolation
124129
}
125130
default {
126131
Write-Error "Unsupported CUDA version: $cuda"
@@ -129,6 +134,7 @@ switch ($cuda) {
129134
}
130135

131136
Write-Host "[INFO] Installing dependencies..."
137+
& ".\runtime\python.exe" -m pip install --pre torchcodec --index-url https://download.pytorch.org/whl/nightly/cpu
132138
& ".\runtime\python.exe" -m pip install -r extra-req.txt --no-deps --no-warn-script-location
133139
& ".\runtime\python.exe" -m pip install -r requirements.txt --no-warn-script-location
134140

@@ -162,7 +168,7 @@ Copy-Item -Path $curr -Destination $pkgName -Recurse
162168
$7zPath = "$pkgName.7z"
163169
$start = Get-Date
164170
Write-Host "Compress Starting at $start"
165-
& "C:\Program Files\7-Zip\7z.exe" a -t7z "$7zPath" "$pkgName" -m0=lzma2 -mx=9 -md=1g -ms=1g -mmc=500 -mfb=273 -mlc=0 -mlp=4 -mpb=4 -mc=8g -mmt=on -bsp1
171+
& "C:\Program Files\7-Zip\7z.exe" a -t7z "$7zPath" "$pkgName" -m0=lzma2 -mx=9 -mmt=on -bsp1
166172
$end = Get-Date
167173
Write-Host "Elapsed time: $($end - $start)"
168174
Get-ChildItem .
@@ -189,6 +195,6 @@ if (-not $hfUser -or -not $hfToken) {
189195
exit 1
190196
}
191197
$env:HF_HUB_ENABLE_HF_TRANSFER = "1"
192-
huggingface-cli upload "$hfUser/GPT-SoVITS-Packages" "$7zPath" "$7zPath" --repo-type model --token $hfToken
198+
hf upload "$hfUser/GPT-SoVITS-Packages" "$7zPath" "$7zPath" --repo-type model --token $hfToken
193199

194200
Write-Host "[SUCCESS] Uploaded: $7zPath to HuggingFace"

.github/workflows/build_windows_packages.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: windows-latest
1818
strategy:
1919
matrix:
20-
torch_cuda: [cu124, cu128]
20+
torch_cuda: [cu126, cu128]
2121
env:
2222
TORCH_CUDA: ${{ matrix.torch_cuda }}
2323
MODELSCOPE_USERNAME: ${{ secrets.MODELSCOPE_USERNAME }}
@@ -31,6 +31,14 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@v4
3333

34+
- name: Install Windows CUDA 12.9
35+
uses: Jimver/[email protected]
36+
id: cuda-toolkit-win-129
37+
with:
38+
cuda: 12.9.0
39+
method: "network"
40+
sub-packages: '["nvcc", "cudart", "visual_studio_integration"]'
41+
3442
- name: Run Build and Upload Script
3543
shell: pwsh
3644
run: |

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ ffprobe*
1616
cfg.json
1717
speakers.json
1818
ref_audios
19-
tools/AP_BWE_main/24kto48k/*
20-
!tools/AP_BWE_main/24kto48k/readme.txt
19+
tools/AP_BWE/24kto48k/*
20+
!tools/AP_BWE/24kto48k/readme.txt
21+
onnx
2122

2223
# Byte-compiled / optimized / DLL files
2324
__pycache__/

Docker/miniconda_install.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ fi
2323

2424
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
2525
"${WGET_CMD[@]}" -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py311_25.3.1-1-Linux-x86_64.sh
26+
SYSROOT_PKG="sysroot_linux-64>=2.28"
2627
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
2728
"${WGET_CMD[@]}" -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py311_25.3.1-1-Linux-aarch64.sh
29+
SYSROOT_PKG="sysroot_linux-aarch64>=2.28"
2830
else
2931
exit 1
3032
fi
@@ -45,20 +47,36 @@ rm miniconda.sh
4547

4648
source "$HOME/miniconda3/etc/profile.d/conda.sh"
4749

50+
"$HOME/miniconda3/bin/conda" init bash
51+
52+
source "$HOME/.bashrc"
53+
4854
"$HOME/miniconda3/bin/conda" config --add channels conda-forge
4955

5056
"$HOME/miniconda3/bin/conda" update -q --all -y 1>/dev/null
5157

5258
"$HOME/miniconda3/bin/conda" install python=3.11 -q -y
5359

54-
"$HOME/miniconda3/bin/conda" install gcc=14 gxx ffmpeg cmake make unzip -q -y
60+
"$HOME/miniconda3/bin/conda" install gcc=11 gxx ffmpeg cmake make unzip $SYSROOT_PKG "libstdcxx-ng>=11" -q -y
5561

5662
if [ "$CUDA_VERSION" = "12.8" ]; then
5763
"$HOME/miniconda3/bin/pip" install torch torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/cu128
64+
"$HOME/miniconda3/bin/conda" install cuda-nvcc=12.8 -c nvidia
5865
elif [ "$CUDA_VERSION" = "12.6" ]; then
59-
"$HOME/miniconda3/bin/pip" install torch==2.6 torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/cu126
66+
"$HOME/miniconda3/bin/pip" install torch torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/cu126
67+
"$HOME/miniconda3/bin/conda" install cuda-nvcc=12.6 -c nvidia
6068
fi
6169

70+
CUDA_PATH=$(echo "$HOME/miniconda3/targets/"*-linux | awk '{print $1}')
71+
72+
export CUDA_HOME=$CUDA_PATH
73+
export PATH="$HOME/miniconda3/bin:$PATH"
74+
export PATH="$CUDA_HOME/bin:$PATH"
75+
export PATH="$CUDA_HOME/nvvm/bin:$PATH"
76+
77+
"$HOME/miniconda3/bin/pip" install psutil ninja packaging wheel "setuptools>=42"
78+
"$HOME/miniconda3/bin/pip" install flash-attn -i https://xxxxrt666.github.io/PIP-Index/ --no-build-isolation
79+
6280
"$HOME/miniconda3/bin/pip" cache purge
6381

6482
rm $LOG_PATH

GPT_SoVITS/AR/__init__.py

Whitespace-only changes.

GPT_SoVITS/AR/data/bucket_sampler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ def __init__(
3939
if num_replicas is None:
4040
if not dist.is_available():
4141
raise RuntimeError("Requires distributed package to be available")
42-
num_replicas = dist.get_world_size() if torch.cuda.is_available() else 1
42+
num_replicas = dist.get_world_size() if torch.cuda.device_count() > 1 else 1
4343
if rank is None:
4444
if not dist.is_available():
4545
raise RuntimeError("Requires distributed package to be available")
46-
rank = dist.get_rank() if torch.cuda.is_available() else 0
47-
if torch.cuda.is_available():
46+
rank = dist.get_rank() if torch.cuda.device_count() > 1 else 0
47+
if torch.cuda.device_count() > 1:
4848
torch.cuda.set_device(rank)
4949
if rank >= num_replicas or rank < 0:
5050
raise ValueError("Invalid rank {}, rank should be in the interval [0, {}]".format(rank, num_replicas - 1))

GPT_SoVITS/AR/data/data_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from pytorch_lightning import LightningDataModule
44
from torch.utils.data import DataLoader
55

6-
from AR.data.bucket_sampler import DistributedBucketSampler
7-
from AR.data.dataset import Text2SemanticDataset
6+
from GPT_SoVITS.AR.data.bucket_sampler import DistributedBucketSampler
7+
from GPT_SoVITS.AR.data.dataset import Text2SemanticDataset
88

99

1010
class Text2SemanticDataModule(LightningDataModule):

GPT_SoVITS/AR/data/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
version = os.environ.get("version", None)
1515

16-
from text import cleaned_text_to_sequence
16+
from GPT_SoVITS.text import cleaned_text_to_sequence
1717

1818
# from config import exp_dir
1919

@@ -220,7 +220,7 @@ def __getitem__(self, idx: int) -> Dict:
220220

221221
flag = 0
222222
path_bert = "%s/%s.pt" % (self.path3, item_name)
223-
if os.path.exists(path_bert) == True:
223+
if os.path.exists(path_bert) is True:
224224
bert_feature = torch.load(path_bert, map_location="cpu")
225225
else:
226226
flag = 1

GPT_SoVITS/AR/models/__init__.py

Whitespace-only changes.

GPT_SoVITS/AR/models/t2s_lightning_module.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/models/t2s_lightning_module.py
22
# reference: https://github.com/lifeiteng/vall-e
3-
import os
4-
import sys
53

6-
now_dir = os.getcwd()
7-
sys.path.append(now_dir)
84
from typing import Dict
95

106
import torch
117
from pytorch_lightning import LightningModule
128

13-
from AR.models.t2s_model import Text2SemanticDecoder
14-
from AR.modules.lr_schedulers import WarmupCosineLRSchedule
15-
from AR.modules.optim import ScaledAdam
9+
from ..modules.lr_schedulers import WarmupCosineLRSchedule
10+
from ..modules.optim import ScaledAdam
11+
from .t2s_model import Text2SemanticDecoder
1612

1713

1814
class Text2SemanticLightningModule(LightningModule):
@@ -42,7 +38,7 @@ def __init__(self, config, output_dir, is_train=True):
4238
def training_step(self, batch: Dict, batch_idx: int):
4339
opt = self.optimizers()
4440
scheduler = self.lr_schedulers()
45-
forward = self.model.forward if self.config["train"].get("if_dpo", False) == True else self.model.forward_old
41+
forward = self.model.forward if self.config["train"].get("if_dpo", False) is True else self.model.forward_old
4642
loss, acc = forward(
4743
batch["phoneme_ids"],
4844
batch["phoneme_ids_len"],

0 commit comments

Comments
 (0)