Keldos commited on
Commit
3ce7848
1 Parent(s): e11c457

fix: 解决Windows下可能报错UnicodeDecodeError的问题

Browse files

UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 313

Files changed (2) hide show
  1. ChuanhuChatbot.py +1 -1
  2. custom.css +6 -7
ChuanhuChatbot.py CHANGED
@@ -50,7 +50,7 @@ else:
50
 
51
  gr.Chatbot.postprocess = postprocess
52
 
53
- with open("custom.css", "r") as f:
54
  customCSS = f.read()
55
 
56
  with gr.Blocks(css=customCSS) as demo:
 
50
 
51
  gr.Chatbot.postprocess = postprocess
52
 
53
+ with open("custom.css", "r", encoding="utf-8") as f:
54
  customCSS = f.read()
55
 
56
  with gr.Blocks(css=customCSS) as demo:
custom.css CHANGED
@@ -11,18 +11,17 @@
11
  color: var(--text-color-subdued) !important;
12
  }
13
  /* chatbot */
14
- /* 大于等于500px的设备 */
15
  @media (min-width: 500px) {
16
  #chuanhu_chatbot {
17
- height: calc(100vh - 200px);
18
  }
19
- }
20
-
21
- /* 小于500px的设备 */
22
  @media (max-width: 499px) {
23
  #chuanhu_chatbot {
24
- height: calc(100vh - 140px);
25
- }
26
  }
27
  /* 对话气泡 */
28
  [class *= "message"] {
 
11
  color: var(--text-color-subdued) !important;
12
  }
13
  /* chatbot */
14
+ /* 屏幕宽度大于等于500px的设备 */
15
  @media (min-width: 500px) {
16
  #chuanhu_chatbot {
17
+ height: calc(100vh - 200px);
18
  }
19
+ }
20
+ /* 屏幕宽度小于500px的设备 */
 
21
  @media (max-width: 499px) {
22
  #chuanhu_chatbot {
23
+ height: calc(100vh - 140px);
24
+ }
25
  }
26
  /* 对话气泡 */
27
  [class *= "message"] {