diff --git a/ChuanhuChatbot.py b/ChuanhuChatbot.py index 0a9a04db..f515fbef 100644 --- a/ChuanhuChatbot.py +++ b/ChuanhuChatbot.py @@ -803,5 +803,5 @@ def create_greeting(request: gr.Request): share=share, auth=auth_from_conf if authflag else None, favicon_path="./web_assets/favicon.ico", - inbrowser=not dockerflag, # 禁止在docker下开启inbrowser + inbrowser=autobrowser and not dockerflag, # 禁止在docker下开启inbrowser ) diff --git a/config_example.json b/config_example.json index 1fc54690..9c4180d1 100644 --- a/config_example.json +++ b/config_example.json @@ -82,4 +82,6 @@ // "server_port": 7860, // 如果要share到gradio,设置为true // "share": false, + //如果不想自动打开浏览器,设置为false + //"autobrowser": false } diff --git a/modules/config.py b/modules/config.py index eb8b1f0f..01cf2166 100644 --- a/modules/config.py +++ b/modules/config.py @@ -24,6 +24,7 @@ "server_name", "server_port", "share", + "autobrowser", "check_update", "latex_delimiters_set", "hide_history_when_not_logged_in", @@ -299,6 +300,7 @@ def update_doc_config(two_column_pdf): logging.error("你填写的默认模型" + default_model + "不存在!请从下面的列表中挑一个填写:" + str(presets.MODELS)) share = config.get("share", False) +autobrowser = config.get("autobrowser", True) # avatar bot_avatar = config.get("bot_avatar", "default")