From a34159d42a98198b3c54cd60d6920af65164e9c2 Mon Sep 17 00:00:00 2001 From: YuChuXi Date: Sat, 27 Jan 2024 14:11:10 +0800 Subject: [PATCH 1/2] =?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 From b6161d2b30c0ea887bba588db809f01517ec8170 Mon Sep 17 00:00:00 2001 From: YuChuXi Date: Sat, 27 Jan 2024 14:28:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E8=AF=95=E4=BB=A3=E7=A0=81=20=E7=A6=81?= =?UTF-8?q?=E7=94=A8SOCK=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webui.py | 1 - 1 file changed, 1 deletion(-) diff --git a/webui.py b/webui.py index 5f3fcb6..0333c4e 100644 --- a/webui.py +++ b/webui.py @@ -29,7 +29,6 @@ os.environ["all_proxy"] = "" for site_packages_root in site_packages_roots: if os.path.exists(site_packages_root): - print(site_packages_roots) try: with open("%s/users.pth" % (site_packages_root), "w+") as f: f.write(