mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-30 10:40:04 +08:00
新增本地模式配置,启用后仅允许本机访问
在`config.py`新增`local_mode`本地模式开关,默认关闭,启用后服务仅限本机访问(127.0.0.1或localhost),可以提升开发调试时的安全性。
This commit is contained in:
parent
13055fa569
commit
7cb00eac17
@ -30,6 +30,9 @@ webui_port_subfix = 9871
|
||||
|
||||
api_port = 9880
|
||||
|
||||
# 设置为True可启用本地模式,该模式只允许本机访问,避免出现潜在安全问题。默认为False。
|
||||
local_mode = False
|
||||
|
||||
if infer_device == "cuda":
|
||||
gpu_name = torch.cuda.get_device_name(0)
|
||||
if (
|
||||
|
3
webui.py
3
webui.py
@ -74,6 +74,7 @@ from config import (
|
||||
webui_port_main,
|
||||
webui_port_subfix,
|
||||
webui_port_uvr5,
|
||||
local_mode,
|
||||
)
|
||||
from tools import my_utils
|
||||
from tools.i18n.i18n import I18nAuto, scan_language_list
|
||||
@ -1955,7 +1956,7 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app:
|
||||
gr.Markdown(value=i18n("施工中,请静候佳音"))
|
||||
|
||||
app.queue().launch( # concurrency_count=511, max_size=1022
|
||||
server_name="0.0.0.0",
|
||||
server_name="127.0.0.1" if local_mode else "0.0.0.0",
|
||||
inbrowser=True,
|
||||
share=is_share,
|
||||
server_port=webui_port_main,
|
||||
|
Loading…
x
Reference in New Issue
Block a user