Update cli demo

visualglm
duzx16 2023-05-18 00:47:28 +08:00
parent de4998cf14
commit eb86299755
1 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,8 @@
import os
import platform
import signal
import sys
from transformers import AutoTokenizer, AutoModel
import readline
@ -52,13 +54,10 @@ def main():
os.system(clear_command)
print(build_prompt(history, prefix), flush=True)
query = input("\n用户:")
if query.strip() == "stop":
break
if query.strip() == "clear":
history = []
os.system(clear_command)
print(prefix)
continue
break
if query.strip() == "stop":
sys.exit(0)
if __name__ == "__main__":