Update cli_demo.py

加了一个判断用户输入本地知识路径是否为空的判断,避免误触回车
This commit is contained in:
keenzhu 2023-05-06 18:34:37 +08:00 committed by GitHub
parent 0a4dd1987d
commit 26393f488b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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: