From a0af8c32de381ad1fdd6207e838c550bc0e10546 Mon Sep 17 00:00:00 2001 From: YuChuXi Date: Sat, 27 Jan 2024 14:11:10 +0800 Subject: [PATCH] =?UTF-8?q?config.py=20:=20=20=20=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E5=9C=A8=E6=A3=80=E6=9F=A5=E5=8D=8A=E7=B2=BE=E5=BA=A6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=89=8D=E4=BC=9A=E5=85=88=E6=A3=80=E6=9F=A5CUDA=20we?= =?UTF-8?q?bui.py=20:=20=20=20=E4=BC=98=E5=8C=96users.py=E7=9A=84=E5=86=99?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 21 +++++++++++---------- webui.py | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 15 deletions(-) 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