File size: 610 Bytes
1ea50ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import subprocess

# 安装 git-lfs
subprocess.run(["git", "lfs", "install"], check=True)

# 克隆仓库
repo_url = "https://huggingface.co/spaces/XzJosh/dingzhen-GPT-SoVITS"
subprocess.run(["git", "clone", repo_url], check=True)

# 如果想在没有大文件的情况下克隆,仅克隆它们的指针
# subprocess.run(["GIT_LFS_SKIP_SMUDGE=1", "git", "clone", repo_url], check=True)

# 复制内容到当前目录
repo_name = repo_url.split('/')[-1]
subprocess.run(["cp", "-r", f"./{repo_name}/.", "."], check=True)

# 删除克隆的目录
subprocess.run(["rm", "-rf", repo_name], check=True)