diff --git a/config.py b/config.py index 97369e7..fef2fac 100644 --- a/config.py +++ b/config.py @@ -29,16 +29,17 @@ webui_port_subfix = 9871 api_port = 9880 -gpu_name = torch.cuda.get_device_name(0) -if ( - ("16" in gpu_name and "V100" not in gpu_name.upper()) - or "P40" in gpu_name.upper() - or "P10" in gpu_name.upper() - or "1060" in gpu_name - or "1070" in gpu_name - or "1080" in gpu_name -): - is_half=False +if infer_device == "cuda": + gpu_name = torch.cuda.get_device_name(0) + if ( + ("16" in gpu_name and "V100" not in gpu_name.upper()) + or "P40" in gpu_name.upper() + or "P10" in gpu_name.upper() + or "1060" in gpu_name + or "1070" in gpu_name + or "1080" in gpu_name + ): + is_half=False if(infer_device=="cpu"):is_half=False diff --git a/webui.py b/webui.py index c71cea3..5f3fcb6 100644 --- a/webui.py +++ b/webui.py @@ -25,13 +25,21 @@ for path in site.getsitepackages(): if(site_packages_roots==[]):site_packages_roots=["%s/runtime/Lib/site-packages" % now_dir] #os.environ["OPENBLAS_NUM_THREADS"] = "4" os.environ["no_proxy"] = "localhost, 127.0.0.1, ::1" +os.environ["all_proxy"] = "" + for site_packages_root in site_packages_roots: if os.path.exists(site_packages_root): - with open("%s/users.pth" % (site_packages_root), "w") as f: - f.write( - "%s\n%s/tools\n%s/tools/damo_asr\n%s/GPT_SoVITS\n%s/tools/uvr5" - % (now_dir, now_dir, now_dir, now_dir, now_dir) - ) + print(site_packages_roots) + try: + with open("%s/users.pth" % (site_packages_root), "w+") as f: + f.write( + "%s\n%s/tools\n%s/tools/damo_asr\n%s/GPT_SoVITS\n%s/tools/uvr5" + % (now_dir, now_dir, now_dir, now_dir, now_dir) + ) + break + except PermissionError: + pass + from tools import my_utils import traceback import shutil