From a1b7a4da56e17082b9a8fcc52424cf65c476c7d9 Mon Sep 17 00:00:00 2001 From: binary-husky Date: Thu, 1 Jun 2023 00:03:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95=E6=A1=88?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/Langchain知识库.py | 4 ++-- crazy_functions/crazy_functions_test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crazy_functions/Langchain知识库.py b/crazy_functions/Langchain知识库.py index 3edb215c..ccd7b2dd 100644 --- a/crazy_functions/Langchain知识库.py +++ b/crazy_functions/Langchain知识库.py @@ -38,13 +38,13 @@ def 知识库问答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro # < --------------------读取文件--------------- > file_manifest = [] - spl = ["txt", "doc", "docx", "email", "epub", "html", "image", "json", "md", "msg", "odt", "pdf", "ppt", "pptx", "rtf", "text"] + spl = ["txt", "doc", "docx", "email", "epub", "html", "json", "md", "msg", "pdf", "ppt", "pptx", "rtf"] for sp in spl: _, file_manifest_tmp, _ = get_files_from_everything(txt, type=f'.{sp}') file_manifest += file_manifest_tmp if len(file_manifest) == 0: - chatbot.append(["没有找到任何可读取文件", "当前支持的格式包括: txt, md, tex"]) + chatbot.append(["没有找到任何可读取文件", "当前支持的格式包括: txt, md, docx, pptx, pdf, json等"]) yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 return diff --git a/crazy_functions/crazy_functions_test.py b/crazy_functions/crazy_functions_test.py index 3d9e1036..fd7d91d8 100644 --- a/crazy_functions/crazy_functions_test.py +++ b/crazy_functions/crazy_functions_test.py @@ -162,14 +162,14 @@ def test_Markdown多语言(): def test_Langchain知识库(): from crazy_functions.Langchain知识库 import 知识库问答 - txt = "README.md" + txt = "./" chatbot = ChatBotWithCookies(llm_kwargs) for cookies, cb, hist, msg in silence_stdout(知识库问答)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port): cli_printer.print(cb) # print(cb) chatbot = ChatBotWithCookies(cookies) from crazy_functions.Langchain知识库 import 读取知识库作答 - txt = "摘要?" + txt = "What is the installation method?" for cookies, cb, hist, msg in silence_stdout(读取知识库作答)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port): cli_printer.print(cb) # print(cb)