3v324v23 commited on
Commit
f76ec64
1 Parent(s): 66dfd11
Files changed (1) hide show
  1. main.py +4 -3
main.py CHANGED
@@ -2,8 +2,6 @@ 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
- #Gradio的分析功能
6
- gr.analytics_enabled = False
7
 
8
  # 建议您复制一个config_private.py放自己的秘密,如API和代理网址,避免不小心传github被别人看到
9
  try: from config_private import proxies, WEB_PORT
@@ -31,7 +29,10 @@ crazy_functional = get_crazy_functionals()
31
  # 处理markdown文本格式的转变
32
  gr.Chatbot.postprocess = format_io
33
 
34
- with gr.Blocks(theme=gr.themes.Default(font=[ "Arial", "sans-serif","Microsoft YaHei"],font_mono=["Arial", "sans-serif","Microsoft YaHei"])) as demo:
 
 
 
35
  gr.HTML(title_html)
36
  with gr.Row():
37
  with gr.Column(scale=2):
 
2
  import gradio as gr
3
  from predict import predict
4
  from toolbox import format_io, find_free_port
 
 
5
 
6
  # 建议您复制一个config_private.py放自己的秘密,如API和代理网址,避免不小心传github被别人看到
7
  try: from config_private import proxies, WEB_PORT
 
29
  # 处理markdown文本格式的转变
30
  gr.Chatbot.postprocess = format_io
31
 
32
+ try: set_theme = gr.themes.Default(font=["Arial", "sans-serif","Microsoft YaHei"], font_mono=["Arial", "sans-serif","Microsoft YaHei"])
33
+ except: set_theme = None
34
+
35
+ with gr.Blocks(theme=set_theme, analytics_enabled=False) as demo:
36
  gr.HTML(title_html)
37
  with gr.Row():
38
  with gr.Column(scale=2):