chore(cli_demo): strip the query input for `stop` or `clear` command

Remove the query space to determine whether it is a stop command or a clear command
pull/322/head
Ashing Zheng 2023-04-01 13:18:28 +08:00 committed by GitHub
parent ff3761fc1a
commit 6dd6f7c7b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -31,9 +31,9 @@ def main():
print("欢迎使用 ChatGLM-6B 模型输入内容即可进行对话clear 清空对话历史stop 终止程序")
while True:
query = input("\n用户:")
if query == "stop":
if query.strip() == "stop":
break
if query == "clear":
if query.strip() == "clear":
history = []
os.system(clear_command)
print("欢迎使用 ChatGLM-6B 模型输入内容即可进行对话clear 清空对话历史stop 终止程序")