Spaces:
Runtime error
Runtime error
ifyz
commited on
Commit
•
bb8b056
1
Parent(s):
dc58745
Update main.py
Browse files使用全局变量,禁用Gradio 的分析功能。解决国内用户因调用GoogleAnalytics导致的加载缓慢。
使用本地字体,修改Gradio默认从Googleapis调用字体。从而解决用户由于国内网络环境打开首页缓慢的问题。
main.py
CHANGED
@@ -2,6 +2,8 @@ import os; os.environ['no_proxy'] = '*'
|
|
2 |
import gradio as gr
|
3 |
from predict import predict
|
4 |
from toolbox import format_io, find_free_port
|
|
|
|
|
5 |
|
6 |
try: from config_private import proxies, WEB_PORT # 放自己的秘密如API和代理网址 os.path.exists('config_private.py')
|
7 |
except: from config import proxies, WEB_PORT
|
|
|
2 |
import gradio as gr
|
3 |
from predict import predict
|
4 |
from toolbox import format_io, find_free_port
|
5 |
+
#Gradio的分析功能
|
6 |
+
gr.analytics_enabled = False
|
7 |
|
8 |
try: from config_private import proxies, WEB_PORT # 放自己的秘密如API和代理网址 os.path.exists('config_private.py')
|
9 |
except: from config import proxies, WEB_PORT
|