Keldos commited on
Commit
bd0034c
·
2 Parent(s): 64eb375 fa02110

Merge branch 'UI'

Browse files

使用js和css大幅更改了输入框和发送按钮的样式和位置

Files changed (4) hide show
  1. ChuanhuChatbot.py +7 -7
  2. assets/custom.css +49 -9
  3. assets/custom.js +173 -52
  4. modules/presets.py +2 -4
ChuanhuChatbot.py CHANGED
@@ -30,10 +30,10 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
30
  topic = gr.State("未命名对话历史记录")
31
 
32
  with gr.Row():
33
- with gr.Column():
34
- gr.HTML(title)
35
- user_info = gr.Markdown(value="", elem_id="user_info")
36
  status_display = gr.Markdown(get_geoip(), elem_id="status_display")
 
 
37
 
38
  # https://github.com/gradio-app/gradio/pull/3296
39
  def create_greeting(request: gr.Request):
@@ -49,14 +49,14 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
49
  with gr.Row():
50
  chatbot = gr.Chatbot(elem_id="chuanhu_chatbot").style(height="100%")
51
  with gr.Row():
52
- with gr.Column(scale=12):
53
  user_input = gr.Textbox(
54
  elem_id="user_input_tb",
55
  show_label=False, placeholder="在这里输入"
56
  ).style(container=False)
57
- with gr.Column(min_width=70, scale=1):
58
- submitBtn = gr.Button("发送", variant="primary")
59
- cancelBtn = gr.Button("取消", variant="secondary", visible=False)
60
  with gr.Row():
61
  emptyBtn = gr.Button(
62
  "🧹 新的对话",
 
30
  topic = gr.State("未命名对话历史记录")
31
 
32
  with gr.Row():
33
+ gr.HTML(title, elem_id="app_title")
 
 
34
  status_display = gr.Markdown(get_geoip(), elem_id="status_display")
35
+ with gr.Row(elem_id="float_display"):
36
+ user_info = gr.Markdown(value="getting user info...", elem_id="user_info")
37
 
38
  # https://github.com/gradio-app/gradio/pull/3296
39
  def create_greeting(request: gr.Request):
 
49
  with gr.Row():
50
  chatbot = gr.Chatbot(elem_id="chuanhu_chatbot").style(height="100%")
51
  with gr.Row():
52
+ with gr.Column(min_width=225, scale=12):
53
  user_input = gr.Textbox(
54
  elem_id="user_input_tb",
55
  show_label=False, placeholder="在这里输入"
56
  ).style(container=False)
57
+ with gr.Column(min_width=42, scale=1):
58
+ submitBtn = gr.Button(value="", variant="primary", elem_id="submit_btn")
59
+ cancelBtn = gr.Button(value="", variant="secondary", visible=False, elem_id="cancel_btn")
60
  with gr.Row():
61
  emptyBtn = gr.Button(
62
  "🧹 新的对话",
assets/custom.css CHANGED
@@ -3,14 +3,18 @@
3
  --chatbot-color-dark: #121111;
4
  }
5
 
 
 
 
 
6
  /* 覆盖gradio的页脚信息QAQ */
7
  footer {
8
  display: none !important;
9
  }
10
- #footer{
11
  text-align: center;
12
  }
13
- #footer div{
14
  display: inline-block;
15
  }
16
  #footer .versions{
@@ -18,16 +22,34 @@ footer {
18
  opacity: 0.85;
19
  }
20
 
21
- /* user_info */
 
 
 
 
22
  #user_info {
23
  white-space: nowrap;
24
- margin-top: -1.3em !important;
25
- padding-left: 112px !important;
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
  #user_info p {
28
- font-size: .85em;
29
- font-family: monospace;
30
- color: var(--body-text-color-subdued);
 
 
 
31
  }
32
 
33
  /* status_display */
@@ -74,7 +96,7 @@ footer {
74
  overflow: hidden;
75
  }
76
  .progress {
77
- background-color: var(--block-title-background-fill);;
78
  height: 100%;
79
  border-radius: 10px;
80
  text-align: right;
@@ -88,6 +110,18 @@ footer {
88
  padding-right: 10px;
89
  line-height: 20px;
90
  }
 
 
 
 
 
 
 
 
 
 
 
 
91
  /* list */
92
  ol:not(.options), ul:not(.options) {
93
  padding-inline-start: 2em !important;
@@ -139,6 +173,12 @@ ol:not(.options), ul:not(.options) {
139
  #chuanhu_chatbot .wrap {
140
  max-height: calc(100vh - 140px - var(--line-sm)*1rem - 2*var(--block-label-margin) );
141
  }
 
 
 
 
 
 
142
  }
143
  /* 对话气泡 */
144
  [class *= "message"] {
 
3
  --chatbot-color-dark: #121111;
4
  }
5
 
6
+ #app_title {
7
+ margin-top: 6px;
8
+ white-space: nowrap;
9
+ }
10
  /* 覆盖gradio的页脚信息QAQ */
11
  footer {
12
  display: none !important;
13
  }
14
+ #footer {
15
  text-align: center;
16
  }
17
+ #footer div {
18
  display: inline-block;
19
  }
20
  #footer .versions{
 
22
  opacity: 0.85;
23
  }
24
 
25
+ #float_display {
26
+ position: absolute;
27
+ max-height: 30px;
28
+ }
29
+ /* user_info */
30
  #user_info {
31
  white-space: nowrap;
32
+ position: absolute; left: 8em; top: .2em;
33
+ z-index: var(--layer-2);
34
+ box-shadow: var(--block-shadow);
35
+ border: none; border-radius: var(--block-label-radius);
36
+ background: var(--color-accent);
37
+ padding: var(--block-label-padding);
38
+ font-size: var(--block-label-text-size); line-height: var(--line-sm);
39
+ width: auto; min-height: 30px!important;
40
+ opacity: 1;
41
+ transition: opacity 0.3s ease-in-out;
42
+ }
43
+ #user_info .wrap {
44
+ opacity: 0;
45
  }
46
  #user_info p {
47
+ color: white;
48
+ font-weight: var(--block-label-text-weight);
49
+ }
50
+ #user_info.hideK {
51
+ opacity: 0;
52
+ transition: opacity 1s ease-in-out;
53
  }
54
 
55
  /* status_display */
 
96
  overflow: hidden;
97
  }
98
  .progress {
99
+ background-color: var(--block-title-background-fill);
100
  height: 100%;
101
  border-radius: 10px;
102
  text-align: right;
 
110
  padding-right: 10px;
111
  line-height: 20px;
112
  }
113
+
114
+ #submit_btn, #cancel_btn {
115
+ height: 42px !important;
116
+ }
117
+ #submit_btn::before {
118
+ content: url("data:image/svg+xml, %3Csvg width='21px' height='20px' viewBox='0 0 21 20' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cg id='page' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E %3Cg id='send' transform='translate(0.435849, 0.088463)' fill='%23FFFFFF' fill-rule='nonzero'%3E %3Cpath d='M0.579148261,0.0428666046 C0.301105539,-0.0961547561 -0.036517765,0.122307382 0.0032026237,0.420210298 L1.4927172,18.1553639 C1.5125774,18.4334066 1.79062012,18.5922882 2.04880264,18.4929872 L8.24518329,15.8913017 L11.6412765,19.7441794 C11.8597387,19.9825018 12.2370824,19.8832008 12.3165231,19.5852979 L13.9450591,13.4882182 L19.7839562,11.0255541 C20.0619989,10.8865327 20.0818591,10.4694687 19.7839562,10.3105871 L0.579148261,0.0428666046 Z M11.6138902,17.0883151 L9.85385903,14.7195502 L0.718169621,0.618812241 L12.69945,12.9346347 L11.6138902,17.0883151 Z' id='shape'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/svg%3E");
119
+ height: 21px;
120
+ }
121
+ #cancel_btn::before {
122
+ content: url("data:image/svg+xml,%3Csvg width='21px' height='21px' viewBox='0 0 21 21' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cg id='page' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E %3Cg id='cancel' transform='translate(0.202054, 0.088463)' fill='%23FFFFFF' fill-rule='nonzero'%3E %3Cpath d='M10.0051467,20 C11.3707325,20 12.6574026,19.7375193 13.865157,19.2125579 C15.0729113,18.6875965 16.1365586,17.9653457 17.0560988,17.0458055 C17.975639,16.1262652 18.6961743,15.0643335 19.2177046,13.8600103 C19.7392349,12.6556871 20,11.3673014 20,9.99485332 C20,8.62926746 19.7375193,7.34259736 19.2125579,6.13484303 C18.6875965,4.92708869 17.9653457,3.86172585 17.0458055,2.9387545 C16.1262652,2.01578315 15.0626179,1.2952479 13.8548636,0.777148739 C12.6471093,0.25904958 11.3604392,0 9.99485332,0 C8.62926746,0 7.34431292,0.25904958 6.13998971,0.777148739 C4.9356665,1.2952479 3.87201921,2.01578315 2.94904786,2.9387545 C2.02607651,3.86172585 1.3038257,4.92708869 0.782295419,6.13484303 C0.26076514,7.34259736 0,8.62926746 0,9.99485332 C0,11.3673014 0.2624807,12.6556871 0.7874421,13.8600103 C1.3124035,15.0643335 2.03465431,16.1262652 2.95419454,17.0458055 C3.87373477,17.9653457 4.9356665,18.6875965 6.13998971,19.2125579 C7.34431292,19.7375193 8.63269858,20 10.0051467,20 Z M10.0051467,18.1677818 C8.87287699,18.1677818 7.81266083,17.9567679 6.8244982,17.5347401 C5.83633556,17.1127123 4.96826214,16.5277063 4.22027792,15.7797221 C3.4722937,15.0317379 2.88900326,14.1636644 2.47040659,13.1755018 C2.05180992,12.1873392 1.84251158,11.127123 1.84251158,9.99485332 C1.84251158,8.86258363 2.05180992,7.80236747 2.47040659,6.81420484 C2.88900326,5.8260422 3.4722937,4.95796878 4.22027792,4.20998456 C4.96826214,3.46200034 5.83462,2.8787099 6.81935152,2.46011323 C7.80408303,2.04151656 8.86258363,1.83221822 9.99485332,1.83221822 C11.127123,1.83221822 12.1890547,2.04151656 13.1806485,2.46011323 C14.1722422,2.8787099 15.0420312,3.46200034 15.7900154,4.20998456 C16.5379997,4.95796878 17.1212901,5.8260422 17.5398868,6.81420484 C17.9584834,7.80236747 18.1677818,8.86258363 18.1677818,9.99485332 C18.1677818,11.127123 17.9584834,12.1873392 17.5398868,13.1755018 C17.1212901,14.1636644 16.5379997,15.0317379 15.7900154,15.7797221 C15.0420312,16.5277063 14.1739578,17.1127123 13.1857952,17.5347401 C12.1976325,17.9567679 11.1374164,18.1677818 10.0051467,18.1677818 Z M7.45239321,13.5357694 L12.5476068,13.5357694 C12.8564076,13.5357694 13.0983016,13.4499914 13.2732887,13.2784354 C13.4482759,13.1068794 13.5357694,12.8701321 13.5357694,12.5681935 L13.5357694,7.41121976 C13.5357694,7.10928118 13.4482759,6.87253388 13.2732887,6.70097787 C13.0983016,6.52942186 12.8564076,6.44364385 12.5476068,6.44364385 L7.45239321,6.44364385 C7.13673014,6.44364385 6.89140504,6.52942186 6.71641791,6.70097787 C6.54143078,6.87253388 6.45393721,7.10928118 6.45393721,7.41121976 L6.45393721,12.5681935 C6.45393721,12.8701321 6.54143078,13.1068794 6.71641791,13.2784354 C6.89140504,13.4499914 7.13673014,13.5357694 7.45239321,13.5357694 Z' id='shape'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/svg%3E");
123
+ height: 21px;
124
+ }
125
  /* list */
126
  ol:not(.options), ul:not(.options) {
127
  padding-inline-start: 2em !important;
 
173
  #chuanhu_chatbot .wrap {
174
  max-height: calc(100vh - 140px - var(--line-sm)*1rem - 2*var(--block-label-margin) );
175
  }
176
+ [data-testid = "bot"] {
177
+ max-width: 98% !important;
178
+ }
179
+ #app_title h1{
180
+ letter-spacing: -1px; font-size: 22px;
181
+ }
182
  }
183
  /* 对话气泡 */
184
  [class *= "message"] {
assets/custom.js CHANGED
@@ -1,4 +1,5 @@
1
  // custom javascript here
 
2
  const MAX_HISTORY_LENGTH = 32;
3
 
4
  var key_down_history = [];
@@ -7,64 +8,184 @@ var user_input_ta;
7
 
8
  var ga = document.getElementsByTagName("gradio-app");
9
  var targetNode = ga[0];
10
- var observer = new MutationObserver(function(mutations) {
 
11
  for (var i = 0; i < mutations.length; i++) {
12
  if (mutations[i].addedNodes.length) {
13
- var user_input_tb = document.getElementById('user_input_tb');
14
- if (user_input_tb) {
15
- // 监听到user_input_tb被添加到DOM树中
16
- // 这里可以编写元素加载完成后需要执行的代码
17
- user_input_ta = user_input_tb.querySelector("textarea");
18
- if (user_input_ta){
19
- observer.disconnect(); // 停止监听
20
- // 在 textarea 上监听 keydown 事件
21
- user_input_ta.addEventListener("keydown", function (event) {
22
- var value = user_input_ta.value.trim();
23
- // 判断按下的是否为方向键
24
- if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
25
- // 如果按下的是方向键,且输入框中有内容,且历史记录中没有该内容,则不执行操作
26
- if(value && key_down_history.indexOf(value) === -1)
27
- return;
28
- // 对于需要响应的动作,阻止默认行为。
29
- event.preventDefault();
30
- var length = key_down_history.length;
31
- if(length === 0) {
32
- currentIndex = -1; // 如果历史记录为空,直接将当前选中的记录重置
33
- return;
34
- }
35
- if (currentIndex === -1) {
36
- currentIndex = length;
37
- }
38
- if (event.code === 'ArrowUp' && currentIndex > 0) {
39
- currentIndex--;
40
- user_input_ta.value = key_down_history[currentIndex];
41
- } else if (event.code === 'ArrowDown' && currentIndex < length - 1) {
42
- currentIndex++;
43
- user_input_ta.value = key_down_history[currentIndex];
44
- }
45
- user_input_ta.selectionStart = user_input_ta.value.length;
46
- user_input_ta.selectionEnd = user_input_ta.value.length;
47
- const input_event = new InputEvent("input", {bubbles: true, cancelable: true});
48
- user_input_ta.dispatchEvent(input_event);
49
- }else if(event.code === "Enter") {
50
- if (value) {
51
- currentIndex = -1;
52
- if(key_down_history.indexOf(value) === -1){
53
- key_down_history.push(value);
54
- if (key_down_history.length > MAX_HISTORY_LENGTH) {
55
- key_down_history.shift();
 
56
  }
57
  }
58
  }
59
- }
60
- });
61
- break;
62
  }
63
- }
64
  }
65
- }
66
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
- // 监听目标节点的子节点列表是否发生变化
69
- observer.observe(targetNode, { childList: true , subtree: true });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
 
 
 
 
1
  // custom javascript here
2
+
3
  const MAX_HISTORY_LENGTH = 32;
4
 
5
  var key_down_history = [];
 
8
 
9
  var ga = document.getElementsByTagName("gradio-app");
10
  var targetNode = ga[0];
11
+
12
+ function selectHistory(mutations) {
13
  for (var i = 0; i < mutations.length; i++) {
14
  if (mutations[i].addedNodes.length) {
15
+ var user_input_tb = document.getElementById('user_input_tb');
16
+ if (user_input_tb) {
17
+ // 监听到user_input_tb被添加到DOM树中
18
+ // 这里可以编写元素加载完成后需要执行的代码
19
+ user_input_ta = user_input_tb.querySelector("textarea");
20
+ if (user_input_ta) {
21
+ observer.disconnect(); // 停止监听
22
+ // 在 textarea 上监听 keydown 事件
23
+ user_input_ta.addEventListener("keydown", function (event) {
24
+ var value = user_input_ta.value.trim();
25
+ // 判断按下的是否为方向键
26
+ if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
27
+ // 如果按下的是方向键,且输入框中有内容,且历史记录中没有该内容,则不执行操作
28
+ if (value && key_down_history.indexOf(value) === -1)
29
+ return;
30
+ // 对于需要响应的动作,阻止默认行为。
31
+ event.preventDefault();
32
+ var length = key_down_history.length;
33
+ if (length === 0) {
34
+ currentIndex = -1; // 如果历史记录为空,直接将当前选中的记录重置
35
+ return;
36
+ }
37
+ if (currentIndex === -1) {
38
+ currentIndex = length;
39
+ }
40
+ if (event.code === 'ArrowUp' && currentIndex > 0) {
41
+ currentIndex--;
42
+ user_input_ta.value = key_down_history[currentIndex];
43
+ } else if (event.code === 'ArrowDown' && currentIndex < length - 1) {
44
+ currentIndex++;
45
+ user_input_ta.value = key_down_history[currentIndex];
46
+ }
47
+ user_input_ta.selectionStart = user_input_ta.value.length;
48
+ user_input_ta.selectionEnd = user_input_ta.value.length;
49
+ const input_event = new InputEvent("input", { bubbles: true, cancelable: true });
50
+ user_input_ta.dispatchEvent(input_event);
51
+ } else if (event.code === "Enter") {
52
+ if (value) {
53
+ currentIndex = -1;
54
+ if (key_down_history.indexOf(value) === -1) {
55
+ key_down_history.push(value);
56
+ if (key_down_history.length > MAX_HISTORY_LENGTH) {
57
+ key_down_history.shift();
58
+ }
59
  }
60
  }
61
  }
62
+ });
63
+ break;
64
+ }
65
  }
 
66
  }
67
+ }
68
+ }
69
+ var userInfoDiv = null;
70
+ function toggleUserInfoVisibility(shouldHide) {
71
+ if (userInfoDiv) {
72
+ if (shouldHide) {
73
+ userInfoDiv.classList.add("hideK");
74
+ } else {
75
+ userInfoDiv.classList.remove("hideK");
76
+ }
77
+ }
78
+ }
79
+ function showOrHideUserInfo() {
80
+ userInfoDiv = document.getElementById("user_info");
81
+ var appTitleDiv = document.getElementById("app_title");
82
+ var sendBtn = document.getElementById("submit_btn");
83
+
84
+ // Bind mouse/touch events to show/hide user info
85
+ appTitleDiv.addEventListener("mouseenter", function () {
86
+ toggleUserInfoVisibility(false);
87
+ });
88
+ userInfoDiv.addEventListener("mouseenter", function () {
89
+ toggleUserInfoVisibility(false);
90
+ });
91
+ sendBtn.addEventListener("mouseenter", function () {
92
+ toggleUserInfoVisibility(false);
93
+ });
94
+
95
+ appTitleDiv.addEventListener("mouseleave", function () {
96
+ toggleUserInfoVisibility(true);
97
+ });
98
+ userInfoDiv.addEventListener("mouseleave", function () {
99
+ toggleUserInfoVisibility(true);
100
+ });
101
+ sendBtn.addEventListener("mouseleave", function () {
102
+ toggleUserInfoVisibility(true);
103
+ });
104
+
105
+ appTitleDiv.ontouchstart = function () {
106
+ toggleUserInfoVisibility(false);
107
+ };
108
+ userInfoDiv.ontouchstart = function () {
109
+ toggleUserInfoVisibility(false);
110
+ };
111
+ sendBtn.ontouchstart = function () {
112
+ toggleUserInfoVisibility(false);
113
+ };
114
 
115
+ appTitleDiv.ontouchend = function () {
116
+ setTimeout(function () {
117
+ toggleUserInfoVisibility(true);
118
+ }, 3000);
119
+ };
120
+ userInfoDiv.ontouchend = function () {
121
+ setTimeout(function () {
122
+ toggleUserInfoVisibility(true);
123
+ }, 3000);
124
+ };
125
+ sendBtn.ontouchend = function () {
126
+ setTimeout(function () {
127
+ toggleUserInfoVisibility(true);
128
+ }, 3000); // Delay 1 second to hide user info
129
+ };
130
+
131
+ // Hide user info after 2 second
132
+ setTimeout(function () {
133
+ toggleUserInfoVisibility(true);
134
+ }, 2000);
135
+ }
136
+
137
+ function setChatbotHeight() {
138
+ const screenWidth = window.innerWidth;
139
+ const statusDisplay = document.querySelector('#status_display');
140
+ const statusDisplayHeight = statusDisplay ? statusDisplay.offsetHeight : 0;
141
+ const chatbot = document.querySelector('#chuanhu_chatbot');
142
+ const vh = window.innerHeight * 0.01;
143
+ document.documentElement.style.setProperty('--vh', `${vh}px`);
144
+ if (screenWidth <= 320) {
145
+ if (chatbot) {
146
+ chatbot.style.height = `calc(var(--vh, 1vh) * 100 - ${statusDisplayHeight + 150}px)`;
147
+ const wrap = chatbot.querySelector('.wrap');
148
+ if (wrap) {
149
+ wrap.style.maxHeight = `calc(var(--vh, 1vh) * 100 - ${statusDisplayHeight + 150}px - var(--line-sm) * 1rem - 2 * var(--block-label-margin))`;
150
+ }
151
+ }
152
+ } else if (screenWidth <= 499) {
153
+ if (chatbot) {
154
+ chatbot.style.height = `calc(var(--vh, 1vh) * 100 - ${statusDisplayHeight + 100}px)`;
155
+ const wrap = chatbot.querySelector('.wrap');
156
+ if (wrap) {
157
+ wrap.style.maxHeight = `calc(var(--vh, 1vh) * 100 - ${statusDisplayHeight + 100}px - var(--line-sm) * 1rem - 2 * var(--block-label-margin))`;
158
+ }
159
+ }
160
+ } else {
161
+ if (chatbot) {
162
+ chatbot.style.height = `calc(var(--vh, 1vh) * 100 - ${statusDisplayHeight + 160}px)`;
163
+ const wrap = chatbot.querySelector('.wrap');
164
+ if (wrap) {
165
+ wrap.style.maxHeight = `calc(var(--vh, 1vh) * 100 - ${statusDisplayHeight + 160}px - var(--line-sm) * 1rem - 2 * var(--block-label-margin))`;
166
+ }
167
+ }
168
+ }
169
+ }
170
+
171
+ setChatbotHeight();
172
+
173
+ var observer = new MutationObserver(function (mutations) {
174
+ selectHistory(mutations);
175
+ showOrHideUserInfo();
176
+ }
177
+ );
178
+ observer.observe(targetNode, { childList: true, subtree: true });
179
+
180
+
181
+ window.addEventListener("DOMContentLoaded", function () {
182
+ setChatbotHeight();
183
+ setTimeout(function () {
184
+ showOrHideUserInfo();
185
+ setChatbotHeight();
186
+ }, 2000);
187
+ });
188
 
189
+ window.addEventListener('resize', setChatbotHeight);
190
+ window.addEventListener('scroll', setChatbotHeight);
191
+
modules/presets.py CHANGED
@@ -30,7 +30,7 @@ CONCURRENT_COUNT = 100 # 允许同时使用的用户数量
30
  SIM_K = 5
31
  INDEX_QUERY_TEMPRATURE = 1.0
32
 
33
- title = """<h1 align="left" style="min-width:200px; margin-top:6px; white-space: nowrap;">川虎ChatGPT 🚀</h1>"""
34
  description = """\
35
  <div align="center" style="margin:16px 0">
36
 
@@ -42,9 +42,7 @@ description = """\
42
  </div>
43
  """
44
 
45
- footer = """\
46
- <div class="versions">{versions}</div>
47
- """
48
 
49
  summarize_prompt = "你是谁?我们刚才聊了什么?" # 总结对话时的 prompt
50
 
 
30
  SIM_K = 5
31
  INDEX_QUERY_TEMPRATURE = 1.0
32
 
33
+ title = """<h1 align="left">川虎ChatGPT 🚀</h1>"""
34
  description = """\
35
  <div align="center" style="margin:16px 0">
36
 
 
42
  </div>
43
  """
44
 
45
+ footer = """<div class="versions">{versions}</div>"""
 
 
46
 
47
  summarize_prompt = "你是谁?我们刚才聊了什么?" # 总结对话时的 prompt
48