Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
•
f2c192a
1
Parent(s):
e719ef5
chore: 微调界面样式
Browse files在字体调用monospace前增设了微软雅黑, resolve #687
- assets/custom.css +10 -7
- modules/utils.py +4 -4
assets/custom.css
CHANGED
@@ -19,13 +19,15 @@
|
|
19 |
}
|
20 |
#description {
|
21 |
text-align: center;
|
22 |
-
margin:
|
23 |
}
|
24 |
|
25 |
-
/*
|
26 |
-
|
27 |
-
display: none !important;
|
28 |
-
|
|
|
|
|
29 |
#footer {
|
30 |
text-align: center;
|
31 |
}
|
@@ -34,7 +36,7 @@
|
|
34 |
}
|
35 |
#footer .versions{
|
36 |
font-size: 85%;
|
37 |
-
opacity: 0.
|
38 |
}
|
39 |
|
40 |
#float_display {
|
@@ -76,7 +78,8 @@
|
|
76 |
}
|
77 |
#status_display p {
|
78 |
font-size: .85em;
|
79 |
-
font-family: monospace;
|
|
|
80 |
color: var(--body-text-color-subdued);
|
81 |
}
|
82 |
|
|
|
19 |
}
|
20 |
#description {
|
21 |
text-align: center;
|
22 |
+
margin: 32px 0 4px 0;
|
23 |
}
|
24 |
|
25 |
+
/* gradio的页脚信息 */
|
26 |
+
footer {
|
27 |
+
/* display: none !important; */
|
28 |
+
margin-top: .2em !important;
|
29 |
+
font-size: 85%;
|
30 |
+
}
|
31 |
#footer {
|
32 |
text-align: center;
|
33 |
}
|
|
|
36 |
}
|
37 |
#footer .versions{
|
38 |
font-size: 85%;
|
39 |
+
opacity: 0.60;
|
40 |
}
|
41 |
|
42 |
#float_display {
|
|
|
78 |
}
|
79 |
#status_display p {
|
80 |
font-size: .85em;
|
81 |
+
font-family: ui-monospace, "SF Mono", "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", "Microsoft Yahei UI", "Microsoft Yahei", monospace;
|
82 |
+
/* Windows下中文的monospace会fallback为新宋体,实在太丑,这里折中使用微软雅黑 */
|
83 |
color: var(--body-text-color-subdued);
|
84 |
}
|
85 |
|
modules/utils.py
CHANGED
@@ -459,8 +459,8 @@ def run(command, desc=None, errdesc=None, custom_env=None, live=False):
|
|
459 |
result = subprocess.run(command, shell=True, env=os.environ if custom_env is None else custom_env)
|
460 |
if result.returncode != 0:
|
461 |
raise RuntimeError(f"""{errdesc or 'Error running command'}.
|
462 |
-
Command: {command}
|
463 |
-
Error code: {result.returncode}""")
|
464 |
|
465 |
return ""
|
466 |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ if custom_env is None else custom_env)
|
@@ -483,7 +483,7 @@ def versions_html():
|
|
483 |
commit_hash = "<none>"
|
484 |
if commit_hash != "<none>":
|
485 |
short_commit = commit_hash[0:7]
|
486 |
-
commit_info = f"<a style=\"text-decoration:none\" href=\"https://github.com/GaiZhenbiao/ChuanhuChatGPT/commit/{short_commit}\">{short_commit}</a>"
|
487 |
else:
|
488 |
commit_info = "unknown \U0001F615"
|
489 |
return f"""
|
@@ -491,7 +491,7 @@ def versions_html():
|
|
491 |
•
|
492 |
Gradio: {gr.__version__}
|
493 |
•
|
494 |
-
|
495 |
"""
|
496 |
|
497 |
def add_source_numbers(lst, source_name = "Source", use_source = True):
|
|
|
459 |
result = subprocess.run(command, shell=True, env=os.environ if custom_env is None else custom_env)
|
460 |
if result.returncode != 0:
|
461 |
raise RuntimeError(f"""{errdesc or 'Error running command'}.
|
462 |
+
Command: {command}
|
463 |
+
Error code: {result.returncode}""")
|
464 |
|
465 |
return ""
|
466 |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ if custom_env is None else custom_env)
|
|
|
483 |
commit_hash = "<none>"
|
484 |
if commit_hash != "<none>":
|
485 |
short_commit = commit_hash[0:7]
|
486 |
+
commit_info = f"<a style=\"text-decoration:none;color:inherit\" href=\"https://github.com/GaiZhenbiao/ChuanhuChatGPT/commit/{short_commit}\">{short_commit}</a>"
|
487 |
else:
|
488 |
commit_info = "unknown \U0001F615"
|
489 |
return f"""
|
|
|
491 |
•
|
492 |
Gradio: {gr.__version__}
|
493 |
•
|
494 |
+
<a style="text-decoration:none;color:inherit" href="https://github.com/GaiZhenbiao/ChuanhuChatGPT">ChuanhuChat</a>: {commit_info}
|
495 |
"""
|
496 |
|
497 |
def add_source_numbers(lst, source_name = "Source", use_source = True):
|