From eb86299755ad032e3b1659eb44b913f137cd68d5 Mon Sep 17 00:00:00 2001 From: duzx16 Date: Thu, 18 May 2023 00:47:28 +0800 Subject: [PATCH] Update cli demo --- cli_demo_vision.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cli_demo_vision.py b/cli_demo_vision.py index f0e217f..b556be0 100644 --- a/cli_demo_vision.py +++ b/cli_demo_vision.py @@ -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__":