File size: 1,501 Bytes
238d4f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d4c4dc9
 
 
 
238d4f8
 
0c44a25
 
 
 
 
 
 
 
 
 
 
238d4f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c44a25
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# main.py

import os
from gui import get_gui
from utils import download_manager

MDX_DOWNLOAD_LINK = "https://github.com/TRvlvr/model_repo/releases/download/all_public_uvr_models/"
UVR_MODELS = [
    "UVR-MDX-NET-Voc_FT.onnx",
    "UVR_MDXNET_KARA_2.onnx",
    "Reverb_HQ_By_FoxJoy.onnx",
    "UVR-MDX-NET-Inst_HQ_4.onnx",
]

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
mdxnet_models_dir = os.path.join(BASE_DIR, "mdx_models")

# Ensure mdx_models is a directory, not a file
if os.path.exists(mdxnet_models_dir) and not os.path.isdir(mdxnet_models_dir):
    os.remove(mdxnet_models_dir)
os.makedirs(mdxnet_models_dir, exist_ok=True)

# Debug: confirm visibility of data.json
json_path = os.path.join(mdxnet_models_dir, "data.json")
print("🔍 Checking for data.json at:", json_path)
print("📁 mdx_models contents:", os.listdir(mdxnet_models_dir))
print("📂 Current working directory:", os.getcwd())

if not os.path.exists(json_path):
    print("❌ data.json NOT FOUND! Check if it's committed or misplaced.")
else:
    print("✅ data.json found.")


def download_models():
    for model in UVR_MODELS:
        url = os.path.join(MDX_DOWNLOAD_LINK, model)
        download_manager(url, mdxnet_models_dir)


if __name__ == "__main__":
    download_models()
    theme = "NoCrypt/miku"
    app = get_gui(theme)
    app.queue(default_concurrency_limit=40)
    app.launch(
        max_threads=40,
        share=False,
        show_error=True,
        quiet=False,
        debug=False,
    )