Spaces:
Build error
Build error
默认暗色护眼主题
Browse files
main.py
CHANGED
@@ -134,10 +134,12 @@ with gr.Blocks(theme=set_theme, analytics_enabled=False, css=advanced_css) as de
|
|
134 |
# gradio的inbrowser触发不太稳定,回滚代码到原始的浏览器打开函数
|
135 |
def auto_opentab_delay():
|
136 |
import threading, webbrowser, time
|
137 |
-
print(f"如果浏览器没有自动打开,请复制并转到以下URL
|
|
|
|
|
138 |
def open():
|
139 |
time.sleep(2)
|
140 |
-
webbrowser.open_new_tab(f"http://localhost:{PORT}")
|
141 |
threading.Thread(target=open, name="open-browser", daemon=True).start()
|
142 |
|
143 |
auto_opentab_delay()
|
|
|
134 |
# gradio的inbrowser触发不太稳定,回滚代码到原始的浏览器打开函数
|
135 |
def auto_opentab_delay():
|
136 |
import threading, webbrowser, time
|
137 |
+
print(f"如果浏览器没有自动打开,请复制并转到以下URL:")
|
138 |
+
print(f"\t(亮色主体): http://localhost:{PORT}")
|
139 |
+
print(f"\t(暗色主体): http://localhost:{PORT}/?__dark-theme=true")
|
140 |
def open():
|
141 |
time.sleep(2)
|
142 |
+
webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true")
|
143 |
threading.Thread(target=open, name="open-browser", daemon=True).start()
|
144 |
|
145 |
auto_opentab_delay()
|