from glob import glob import os weight_files = glob('assets/weights/*', recursive=True) indices_files = glob('assets/indices/*', recursive=True) main_directory = "https://huggingface.co/spaces/darylfunggg/rvc-spleeter-voice/resolve/main/" weights = {'custom': None} for weight_file in weight_files: weights[os.path.splitext(os.path.basename(weight_file))[0]] = f"{main_directory}{weight_file}" indices = {'custom': None} for indices_file in indices_files: indices[os.path.basename(indices_file).split("_")[0]] = f"{main_directory}{indices_file}" assert len(weights) == len(indices)