Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
ead342e
1
Parent(s):
b06d3c4
修复了大段用户输入时溢出的问题
Browse files- ChuanhuChatbot.py +1 -1
- assets/favicon.ico +0 -0
- assets/favicon.png +0 -0
- modules/utils.py +2 -1
ChuanhuChatbot.py
CHANGED
@@ -414,7 +414,7 @@ if __name__ == "__main__":
|
|
414 |
)
|
415 |
else:
|
416 |
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
|
417 |
-
share=False, favicon_path="./assets/favicon.
|
418 |
) # 改为 share=True 可以创建公开分享链接
|
419 |
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False) # 可自定义端口
|
420 |
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860,auth=("在这里填写用户名", "在这里填写密码")) # 可设置用户名与密码
|
|
|
414 |
)
|
415 |
else:
|
416 |
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
|
417 |
+
share=False, favicon_path="./assets/favicon.ico", inbrowser=True
|
418 |
) # 改为 share=True 可以创建公开分享链接
|
419 |
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False) # 可自定义端口
|
420 |
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860,auth=("在这里填写用户名", "在这里填写密码")) # 可设置用户名与密码
|
assets/favicon.ico
ADDED
assets/favicon.png
DELETED
Binary file (5.16 kB)
|
|
modules/utils.py
CHANGED
@@ -115,7 +115,8 @@ def convert_mdtext(md_text):
|
|
115 |
|
116 |
|
117 |
def convert_asis(userinput):
|
118 |
-
|
|
|
119 |
|
120 |
def detect_converted_mark(userinput):
|
121 |
if userinput.endswith(ALREADY_CONVERTED_MARK):
|
|
|
115 |
|
116 |
|
117 |
def convert_asis(userinput):
|
118 |
+
escaped_html = html.escape(userinput).replace(" ", " ").replace("\n", "<br>")
|
119 |
+
return f"{escaped_html}"+ALREADY_CONVERTED_MARK
|
120 |
|
121 |
def detect_converted_mark(userinput):
|
122 |
if userinput.endswith(ALREADY_CONVERTED_MARK):
|