Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
5dc3671
1
Parent(s):
fd3d76e
缓解生成大量</br>标签的问题
Browse files- ChuanhuChatbot.py +5 -2
ChuanhuChatbot.py
CHANGED
|
@@ -56,8 +56,11 @@ def parse_text(text):
|
|
| 56 |
line = line.replace("<", "<")
|
| 57 |
line = line.replace(">", ">")
|
| 58 |
line = line.replace(" ", " ")
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
| 61 |
return "".join(lines)
|
| 62 |
|
| 63 |
def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[], system_prompt=initial_prompt, retry=False, summary=False): # repetition_penalty, top_k
|
|
|
|
| 56 |
line = line.replace("<", "<")
|
| 57 |
line = line.replace(">", ">")
|
| 58 |
line = line.replace(" ", " ")
|
| 59 |
+
# lines[i] = '<br/>'+line
|
| 60 |
+
if i > 0 and count % 2 == 0:
|
| 61 |
+
lines[i] = "<br/>"+line
|
| 62 |
+
else:
|
| 63 |
+
lines[i] = line
|
| 64 |
return "".join(lines)
|
| 65 |
|
| 66 |
def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[], system_prompt=initial_prompt, retry=False, summary=False): # repetition_penalty, top_k
|