Commit
路
a78dfde
1
Parent(s):
6af679d
Rename Dl.py to Ah.py
Browse files
Ah.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import requests
|
| 3 |
+
|
| 4 |
+
# Set the directory where you want to save the files
|
| 5 |
+
save_dir = "/content/Advanced-RVC-Inference/"
|
| 6 |
+
|
| 7 |
+
# Set the URLs of the files you want to download
|
| 8 |
+
file_urls = [
|
| 9 |
+
"https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt",
|
| 10 |
+
"https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt"
|
| 11 |
+
]
|
| 12 |
+
|
| 13 |
+
# Loop through the URLs and download each file
|
| 14 |
+
for file_url in file_urls:
|
| 15 |
+
# Get the filename from the URL
|
| 16 |
+
filename = file_url.split("/")[-1]
|
| 17 |
+
|
| 18 |
+
# Create the full path to save the file
|
| 19 |
+
save_path = os.path.join(save_dir, filename)
|
| 20 |
+
|
| 21 |
+
# Download the file
|
| 22 |
+
response = requests.get(file_url)
|
| 23 |
+
|
| 24 |
+
# Save the file to disk
|
| 25 |
+
with open(save_path, "wb") as f:
|
| 26 |
+
f.write(response.content)
|
Dl.py
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import subprocess
|
| 3 |
-
|
| 4 |
-
# Diret贸rio de destino
|
| 5 |
-
destination_directory = "/content/Advanced-RVC-Inference"
|
| 6 |
-
|
| 7 |
-
# URLs dos modelos
|
| 8 |
-
hubert_url = "https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt"
|
| 9 |
-
rmvpe_url = "https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt"
|
| 10 |
-
|
| 11 |
-
# Fun莽茫o para fazer o download com wget
|
| 12 |
-
def download_with_wget(url, output_file):
|
| 13 |
-
subprocess.call(["wget", "-c", "--tries=0", "--read-timeout=5", "--timeout=60", "--waitretry=5", "--quiet", "--show-progress", "-O", output_file, url])
|
| 14 |
-
|
| 15 |
-
# Verifica se o diret贸rio de destino existe, sen茫o, cria
|
| 16 |
-
if not os.path.exists(destination_directory):
|
| 17 |
-
os.makedirs(destination_directory)
|
| 18 |
-
|
| 19 |
-
# Realiza os downloads
|
| 20 |
-
download_with_wget(hubert_url, os.path.join(destination_directory, "hubert_base.pt"))
|
| 21 |
-
download_with_wget(rmvpe_url, os.path.join(destination_directory, "rmvpe.pt"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|