From 426e1a2bb43614af2479b877c37acfb0591e952f Mon Sep 17 00:00:00 2001 From: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Date: Thu, 10 Jul 2025 18:16:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=8E=A8=E7=90=86=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E4=BC=98=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPT_SoVITS/inference_webui_fast.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/GPT_SoVITS/inference_webui_fast.py b/GPT_SoVITS/inference_webui_fast.py index 470b7bb..2c159d8 100644 --- a/GPT_SoVITS/inference_webui_fast.py +++ b/GPT_SoVITS/inference_webui_fast.py @@ -6,7 +6,20 @@ 全部按英文识别 全部按日文识别 """ +import psutil +import os +def set_high_priority(): + """把当前 Python 进程设为 HIGH_PRIORITY_CLASS""" + if os.name != "nt": + return # 仅 Windows 有效 + p = psutil.Process(os.getpid()) + try: + p.nice(psutil.HIGH_PRIORITY_CLASS) + print("已将进程优先级设为 High") + except psutil.AccessDenied: + print("权限不足,无法修改优先级(请用管理员运行)") +set_high_priority() import json import logging import os