File size: 2,076 Bytes
c3f2d33
8b529d8
d10b230
 
54d26a5
3d2a1da
 
194d3a4
8b529d8
 
 
d10b230
3d2a1da
 
54dfc90
33be5fd
 
7916f83
54dfc90
3d2a1da
 
54d26a5
bc9ca81
54dfc90
 
33be5fd
 
7916f83
40658aa
e9b2cd9
bc9ca81
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import subprocess
from huggingface_hub import login



# Example command to set an environment variable (this is not effective for parent Python processes)
token=os.environ['token']
#access_token_read = token
#login(token = access_token_read)
subprocess.run(["huggingface-cli", "login", "--token", token])
#os.environ['HUGGINGFACE_TOKEN'] = token

# This will not make HUGGINGFACE_TOKEN accessible in the Python script outside the os.system call.
command = f"curl -L -H 'Authorization: Bearer {token}' 'https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/main/trips.pth' -o ./weights/trips.pth"
command1 = f"curl -L -H 'Authorization: Bearer {token}' 'https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/main/modi.pth' -o ./weights/modi.pth"
command2 = f"curl -L -H 'Authorization: Bearer {token}' 'https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/main/khujli.pth' -o ./weights/khujli.pth"
command3 = f"curl -L -H 'Authorization: Bearer {token}' 'https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/main/kishorkumar.pth' -o ./weights/kishorkumar.pth"



os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d . -o hubert_base.pt")
os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d . -o rmvpe.pt")
#os.system("curl -L -H 'Authorization: Bearer token' "https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/main/trips.pth" -o ./weights/trips.pth")
os.system(command)
os.system(command1)
os.system(command2)
os.system(command3)
#os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/main/trips.pth -d ./weights -o trips.pth")
os.system("aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/sail-rvc/yoimiya-jp/resolve/main/model.index -d ./weights/index -o yoimiya.index")

os.system("python infer.py")