simondby
commited on
Commit
·
d65b470
1
Parent(s):
22519e8
update
Browse files- .gitignore +3 -1
- assets/Kelpy-Codos.js +7 -6
- assets/custom.css +10 -0
- modules/chat_func.py +2 -1
.gitignore
CHANGED
@@ -136,4 +136,6 @@ dmypy.json
|
|
136 |
api_key.txt
|
137 |
|
138 |
auth.json
|
139 |
-
.idea
|
|
|
|
|
|
136 |
api_key.txt
|
137 |
|
138 |
auth.json
|
139 |
+
.idea
|
140 |
+
|
141 |
+
deprecated/
|
assets/Kelpy-Codos.js
CHANGED
@@ -21,12 +21,13 @@
|
|
21 |
}
|
22 |
var button = document.createElement('button');
|
23 |
button.textContent = '\uD83D\uDCCB'; // 使用 📋 符号作为“复制”按钮的文本
|
24 |
-
button.
|
25 |
-
button.style.
|
26 |
-
button.style.
|
27 |
-
button.style.
|
28 |
-
button.style.
|
29 |
-
button.style.
|
|
|
30 |
button.addEventListener('click', function () {
|
31 |
var range = document.createRange();
|
32 |
range.selectNodeContents(code);
|
|
|
21 |
}
|
22 |
var button = document.createElement('button');
|
23 |
button.textContent = '\uD83D\uDCCB'; // 使用 📋 符号作为“复制”按钮的文本
|
24 |
+
button.className = 'copy-button';
|
25 |
+
// button.style.position = 'relative';
|
26 |
+
// button.style.float = 'right';
|
27 |
+
// button.style.fontSize = '1em'; // 可选:调整按钮大小
|
28 |
+
// button.style.background = 'none'; // 可选:去掉背景颜色
|
29 |
+
// button.style.border = 'none'; // 可选:去掉边框
|
30 |
+
// button.style.cursor = 'pointer'; // 可选:显示指针样式
|
31 |
button.addEventListener('click', function () {
|
32 |
var range = document.createRange();
|
33 |
range.selectNodeContents(code);
|
assets/custom.css
CHANGED
@@ -194,6 +194,16 @@ pre code {
|
|
194 |
color: #FFF;
|
195 |
box-shadow: 6px 6px 16px hsla(0, 0%, 0%, 0.2);
|
196 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
/* 代码高亮样式 */
|
198 |
.highlight .hll { background-color: #49483e }
|
199 |
.highlight .c { color: #75715e } /* Comment */
|
|
|
194 |
color: #FFF;
|
195 |
box-shadow: 6px 6px 16px hsla(0, 0%, 0%, 0.2);
|
196 |
}
|
197 |
+
|
198 |
+
.copy-button {
|
199 |
+
position: absolute;
|
200 |
+
right: 4em;
|
201 |
+
float: right;
|
202 |
+
font-size: 1em;
|
203 |
+
background: none;
|
204 |
+
border: none;
|
205 |
+
cursor: pointer;
|
206 |
+
}
|
207 |
/* 代码高亮样式 */
|
208 |
.highlight .hll { background-color: #49483e }
|
209 |
.highlight .c { color: #75715e } /* Comment */
|
modules/chat_func.py
CHANGED
@@ -135,7 +135,8 @@ def stream_predict(
|
|
135 |
yield get_return_value()
|
136 |
error_json_str = ""
|
137 |
|
138 |
-
for chunk in tqdm(response.iter_lines()):
|
|
|
139 |
if counter == 0:
|
140 |
counter += 1
|
141 |
continue
|
|
|
135 |
yield get_return_value()
|
136 |
error_json_str = ""
|
137 |
|
138 |
+
# for chunk in tqdm(response.iter_lines()):
|
139 |
+
for chunk in response.iter_lines():
|
140 |
if counter == 0:
|
141 |
counter += 1
|
142 |
continue
|