feat(core): support custom local dl path

This commit is contained in:
源文雨
2025-01-07 21:02:39 +09:00
parent aaea2ae2d6
commit fefc931873
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -74,7 +74,7 @@ class Chat:
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
):
+3 -2
View File
@@ -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
@@ -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/"
@@ -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",
]
)