3v324v23 commited on
Commit
6d55c4f
1 Parent(s): f76ec64

调整样式

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -29,8 +29,12 @@ crazy_functional = get_crazy_functionals()
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)
 
29
  # 处理markdown文本格式的转变
30
  gr.Chatbot.postprocess = format_io
31
 
32
+ # 做一些样式上的调整
33
+ try: set_theme = gr.themes.Default( primary_hue=gr.themes.utils.colors.orange,
34
+ font=["ui-sans-serif", "system-ui", "sans-serif", gr.themes.utils.fonts.GoogleFont("Source Sans Pro")],
35
+ font_mono=["ui-monospace", "Consolas", "monospace", gr.themes.utils.fonts.GoogleFont("IBM Plex Mono")])
36
+ except:
37
+ set_theme = None; print('gradio 版本老旧,不能自定义字体和颜色')
38
 
39
  with gr.Blocks(theme=set_theme, analytics_enabled=False) as demo:
40
  gr.HTML(title_html)