|
1 | | - |
2 | | - |
3 | 1 | import subprocess |
4 | | - |
5 | | - |
6 | | - |
7 | | -command1 = [ |
8 | | - "aria2c", |
9 | | - "--console-log-level=error", |
10 | | - "-c", |
11 | | - "-x", "16", |
12 | | - "-s", "16", |
13 | | - "-k", "1M", |
14 | | - "https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt", |
15 | | - "-d", "/content/Advanced-RVC-Inference", |
16 | | - "-o", "hubert_base.pt" |
17 | | -] |
18 | | - |
19 | | - |
20 | | -command2 = [ |
21 | | - "aria2c", |
22 | | - "--console-log-level=error", |
23 | | - "-c", |
24 | | - "-x", "16", |
25 | | - "-s", "16", |
26 | | - "-k", "1M", |
27 | | - "https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt", |
28 | | - "-d", "/content/Advanced-RVC-Inference", |
29 | | - "-o", "rmvpe.pt" |
30 | | -] |
31 | | - |
32 | | - |
33 | | -subprocess.run(command1) |
34 | | - |
35 | | - |
36 | | -subprocess.run(command2) |
37 | | - |
38 | | -print("done") |
| 2 | +import os |
| 3 | + |
| 4 | +def download_file(url, output_name, destination): |
| 5 | + command = [ |
| 6 | + "aria2c", |
| 7 | + "--console-log-level=error", |
| 8 | + "-c", |
| 9 | + "-x", "16", |
| 10 | + "-s", "16", |
| 11 | + "-k", "1M", |
| 12 | + url, |
| 13 | + "-d", destination, |
| 14 | + "-o", output_name |
| 15 | + ] |
| 16 | + subprocess.run(command) |
| 17 | + |
| 18 | +if __name__ == "__main__": |
| 19 | + current_directory = os.getcwd() |
| 20 | + |
| 21 | + # List of files to download |
| 22 | + files_to_download = [ |
| 23 | + { |
| 24 | + "url": "https://huggingface.co/theNeofr/rvc-base/resolve/main/hubert_base.pt", |
| 25 | + "output_name": "hubert_base.pt" |
| 26 | + }, |
| 27 | + { |
| 28 | + "url": "https://huggingface.co/theNeofr/rvc-base/resolve/main/rmvpe.pt", |
| 29 | + "output_name": "rmvpe.pt" |
| 30 | + }, |
| 31 | + { |
| 32 | + "url": "https://huggingface.co/theNeofr/rvc-base/resolve/main/fcpe.pt", |
| 33 | + "output_name": "fcpe.pt" |
| 34 | + } |
| 35 | + ] |
| 36 | + |
| 37 | + # Download each file |
| 38 | + for file in files_to_download: |
| 39 | + download_file(file["url"], file["output_name"], current_directory) |
| 40 | + |
| 41 | + print("Download completed.") |
0 commit comments