From 23c1b14ca3a5af64d3f5ce831c3c4bd5c47928f2 Mon Sep 17 00:00:00 2001 From: qingxu fu <505030475@qq.com> Date: Mon, 3 Apr 2023 20:56:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9A=97=E8=89=B2=E6=8A=A4?= =?UTF-8?q?=E7=9C=BC=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0f0fe92..973d16f 100644 --- a/main.py +++ b/main.py @@ -134,10 +134,12 @@ with gr.Blocks(theme=set_theme, analytics_enabled=False, css=advanced_css) as de # gradio的inbrowser触发不太稳定,回滚代码到原始的浏览器打开函数 def auto_opentab_delay(): import threading, webbrowser, time - print(f"如果浏览器没有自动打开,请复制并转到以下URL: http://localhost:{PORT}") + print(f"如果浏览器没有自动打开,请复制并转到以下URL:") + print(f"\t(亮色主体): http://localhost:{PORT}") + print(f"\t(暗色主体): http://localhost:{PORT}/?__dark-theme=true") def open(): time.sleep(2) - webbrowser.open_new_tab(f"http://localhost:{PORT}") + webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true") threading.Thread(target=open, name="open-browser", daemon=True).start() auto_opentab_delay()