From b6b193a3360e6e3cd231c584520bfbee41d5f7fc Mon Sep 17 00:00:00 2001 From: Ioann Volkov Date: Sat, 29 Mar 2025 14:13:02 +0200 Subject: [PATCH] Use system temp dir to avoid OSError about too long path --- infer-web.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer-web.py b/infer-web.py index 47596d5..0e8ff4e 100644 --- a/infer-web.py +++ b/infer-web.py @@ -31,6 +31,7 @@ import traceback import threading import shutil import logging +import tempfile logging.getLogger("numba").setLevel(logging.WARNING) @@ -38,7 +39,7 @@ logging.getLogger("httpx").setLevel(logging.WARNING) logger = logging.getLogger(__name__) -tmp = os.path.join(now_dir, "TEMP") +tmp = os.path.join(tempfile.gettempdir(), "RVC") shutil.rmtree(tmp, ignore_errors=True) shutil.rmtree("%s/runtime/Lib/site-packages/infer_pack" % (now_dir), ignore_errors=True) shutil.rmtree("%s/runtime/Lib/site-packages/uvr5_pack" % (now_dir), ignore_errors=True)