Skip to content

Commit

Permalink
config.py :
Browse files Browse the repository at this point in the history
  现在在检查半精度计算前会先检查CUDA
webui.py :
  优化users.py的写入
  • Loading branch information
YuChuXi committed Jan 27, 2024
1 parent f9387e0 commit a0af8c3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
21 changes: 11 additions & 10 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@

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

Expand Down
18 changes: 13 additions & 5 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@
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
Expand Down

0 comments on commit a0af8c3

Please sign in to comment.