CoolFace
Apppublic

Rifd/Ultimate-Vocal-Remover-WebUI

sourceHugging Facemitupdated 3y agoView on Hugging Face
5likes
old_data_check.py27 linesDownload Raw Back to gui_data
1import os2import shutil3 4def file_check(original_dir, new_dir):5    6    if os.path.isdir(original_dir):7        for file in os.listdir(original_dir):8            shutil.move(os.path.join(original_dir, file), os.path.join(new_dir, file))9          10        if len(os.listdir(original_dir)) == 0:11            shutil.rmtree(original_dir) 12            13def remove_unneeded_yamls(demucs_dir):14    15    for file in os.listdir(demucs_dir):16        if file.endswith('.yaml'):17            if os.path.isfile(os.path.join(demucs_dir, file)):18                os.remove(os.path.join(demucs_dir, file))19    20def remove_temps(remove_dir):21    22    if os.path.isdir(remove_dir):23        try:24            shutil.rmtree(remove_dir) 25        except Exception as e:26            print(e)27