This commit is contained in:
JohnSaxon 2023-05-10 13:28:44 +08:00 committed by GitHub
parent 980019fb73
commit 466bfb7a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -242,7 +242,7 @@ if __name__ == "__main__":
vs_path=vs_path,
chat_history=[],
streaming=True):
print(resp["result"][last_print_len:], end="", flush=True)
print(resp["result"][last_print_len:])
last_print_len = len(resp["result"])
source_text = [f"""出处 [{inum + 1}] {os.path.split(doc.metadata['source'])[-1]}\n\n{doc.page_content}\n\n"""
# f"""相关度:{doc.metadata['score']}\n\n"""

View File

@ -31,7 +31,7 @@ if __name__ == "__main__":
chat_history=history,
streaming=STREAMING):
if STREAMING:
logger.info(resp["result"][last_print_len:], end="", flush=True)
logger.info(resp["result"][last_print_len:])
last_print_len = len(resp["result"])
else:
logger.info(resp["result"])

View File

@ -175,7 +175,7 @@ if __name__ == "__main__":
llm_device=LLM_DEVICE, )
last_print_len = 0
for resp, history in llm._call("你好", streaming=True):
logger.info(resp[last_print_len:], end="", flush=True)
logger.info(resp[last_print_len:])
last_print_len = len(resp)
for resp, history in llm._call("你好", streaming=False):
logger.info(resp)