From 4e3c69043cf0772f02125a63e70af835ca702904 Mon Sep 17 00:00:00 2001 From: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Date: Thu, 10 Jul 2025 18:16:24 +0800 Subject: [PATCH] Update inference_webui.py --- GPT_SoVITS/inference_webui.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index 643e405..a361ed5 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.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