Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,26 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
def sorted(filepath):
|
5 |
return os.listdir(filepath)
|
6 |
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
|
4 |
+
import subprocess, os
|
5 |
+
assets_folder = "assets"
|
6 |
+
if not os.path.exists(assets_folder):
|
7 |
+
os.makedirs(assets_folder)
|
8 |
+
files = {
|
9 |
+
"rmvpe/rmvpe.pt":"https://huggingface.co/Rejekts/project/resolve/main/rmvpe.pt",
|
10 |
+
"hubert/hubert_base.pt":"https://huggingface.co/Rejekts/project/resolve/main/hubert_base.pt",
|
11 |
+
"pretrained_v2/D40k.pth":"https://huggingface.co/Rejekts/project/resolve/main/D40k.pth",
|
12 |
+
"pretrained_v2/G40k.pth":"https://huggingface.co/Rejekts/project/resolve/main/G40k.pth",
|
13 |
+
"pretrained_v2/f0D40k.pth":"https://huggingface.co/Rejekts/project/resolve/main/f0D40k.pth",
|
14 |
+
"pretrained_v2/f0G40k.pth":"https://huggingface.co/Rejekts/project/resolve/main/f0G40k.pth"
|
15 |
+
}
|
16 |
+
for file, link in files.items():
|
17 |
+
file_path = os.path.join(assets_folder, file)
|
18 |
+
if not os.path.exists(file_path):
|
19 |
+
try:
|
20 |
+
subprocess.run(['wget', link, '-O', file_path], check=True)
|
21 |
+
except subprocess.CalledProcessError as e:
|
22 |
+
print(f"Error downloading {file}: {e}")
|
23 |
+
|
24 |
def sorted(filepath):
|
25 |
return os.listdir(filepath)
|
26 |
|