Skip to content

Commit

Permalink
feat(core): support custom local dl path
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jan 7, 2025
1 parent aaea2ae commit fefc931
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checksum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Run RVC-Models-Downloader
run: |
wget https://github.com/fumiama/RVC-Models-Downloader/releases/download/v0.2.9/rvcmd_linux_amd64.deb
wget https://github.com/fumiama/RVC-Models-Downloader/releases/download/v0.2.10/rvcmd_linux_amd64.deb
sudo apt -y install ./rvcmd_linux_amd64.deb
rm -f ./rvcmd_linux_amd64.deb
rvcmd -notrs -w 1 -notui assets/chtts
Expand Down
2 changes: 1 addition & 1 deletion ChatTTS/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def download_models(
or force_redownload
):
with tempfile.TemporaryDirectory() as tmp:
download_all_assets(tmpdir=tmp)
download_all_assets(tmpdir=tmp, homedir=download_path)
if not check_all_assets(
Path(download_path), self.sha256_map, update=False
):
Expand Down
5 changes: 3 additions & 2 deletions ChatTTS/utils/dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def download_dns_yaml(url: str, folder: str, headers: Dict[str, str]):
logger.get_logger().info(f"downloaded into {folder}")


def download_all_assets(tmpdir: str, version="0.2.9"):
def download_all_assets(tmpdir: str, homedir: str, version="0.2.10"):
import subprocess
import platform

Expand Down Expand Up @@ -186,7 +186,7 @@ def download_all_assets(tmpdir: str, version="0.2.9"):
else:
download_and_extract_tar_gz(RVCMD_URL, tmpdir)
os.chmod(cmdfile, 0o755)
subprocess.run([cmdfile, "-notui", "-w", "0", "assets/chtts"])
subprocess.run([cmdfile, "-notui", "-w", "0", "-H", homedir, "assets/chtts"])
except Exception:
BASE_URL = (
"https://gitea.seku.su/fumiama/RVC-Models-Downloader/releases/download/"
Expand Down Expand Up @@ -215,6 +215,7 @@ def download_all_assets(tmpdir: str, version="0.2.9"):
"0",
"-dns",
os.path.join(tmpdir, "dns.yaml"),
"-H", homedir,
"assets/chtts",
]
)

0 comments on commit fefc931

Please sign in to comment.