Unverified 提交 466bfb7a 作者: JohnSaxon 提交者: GitHub

logger bug introduced by…

logger bug introduced by https://github.com/imClumsyPanda/langchain-ChatGLM/pull/268 , fixed #295 (#297)
上级 980019fb
......@@ -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"""
......
......@@ -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"])
......
......@@ -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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论