Skip to content

Commit fefc931

Browse files
committed
feat(core): support custom local dl path
1 parent aaea2ae commit fefc931

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/workflows/checksum.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
- name: Run RVC-Models-Downloader
1515
run: |
16-
wget https://github.com/fumiama/RVC-Models-Downloader/releases/download/v0.2.9/rvcmd_linux_amd64.deb
16+
wget https://github.com/fumiama/RVC-Models-Downloader/releases/download/v0.2.10/rvcmd_linux_amd64.deb
1717
sudo apt -y install ./rvcmd_linux_amd64.deb
1818
rm -f ./rvcmd_linux_amd64.deb
1919
rvcmd -notrs -w 1 -notui assets/chtts

ChatTTS/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def download_models(
7474
or force_redownload
7575
):
7676
with tempfile.TemporaryDirectory() as tmp:
77-
download_all_assets(tmpdir=tmp)
77+
download_all_assets(tmpdir=tmp, homedir=download_path)
7878
if not check_all_assets(
7979
Path(download_path), self.sha256_map, update=False
8080
):

ChatTTS/utils/dl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def download_dns_yaml(url: str, folder: str, headers: Dict[str, str]):
151151
logger.get_logger().info(f"downloaded into {folder}")
152152

153153

154-
def download_all_assets(tmpdir: str, version="0.2.9"):
154+
def download_all_assets(tmpdir: str, homedir: str, version="0.2.10"):
155155
import subprocess
156156
import platform
157157

@@ -186,7 +186,7 @@ def download_all_assets(tmpdir: str, version="0.2.9"):
186186
else:
187187
download_and_extract_tar_gz(RVCMD_URL, tmpdir)
188188
os.chmod(cmdfile, 0o755)
189-
subprocess.run([cmdfile, "-notui", "-w", "0", "assets/chtts"])
189+
subprocess.run([cmdfile, "-notui", "-w", "0", "-H", homedir, "assets/chtts"])
190190
except Exception:
191191
BASE_URL = (
192192
"https://gitea.seku.su/fumiama/RVC-Models-Downloader/releases/download/"
@@ -215,6 +215,7 @@ def download_all_assets(tmpdir: str, version="0.2.9"):
215215
"0",
216216
"-dns",
217217
os.path.join(tmpdir, "dns.yaml"),
218+
"-H", homedir,
218219
"assets/chtts",
219220
]
220221
)

0 commit comments

Comments
 (0)