From 26393f488b4ef82ad7380664597b4e815f5490f9 Mon Sep 17 00:00:00 2001 From: keenzhu Date: Sat, 6 May 2023 18:34:37 +0800 Subject: [PATCH] Update cli_demo.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 加了一个判断用户输入本地知识路径是否为空的判断,避免误触回车 --- cli_demo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli_demo.py b/cli_demo.py index 64aaeb0..7110196 100644 --- a/cli_demo.py +++ b/cli_demo.py @@ -18,6 +18,9 @@ if __name__ == "__main__": vs_path = None while not vs_path: filepath = input("Input your local knowledge file path 请输入本地知识文件路径:") + #判断filepath是否为空,如果为空的话,重新让用户输入,防止用户误触回车 + if not filepath: + continue vs_path, _ = local_doc_qa.init_knowledge_vector_store(filepath) history = [] while True: