Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

[BUG] 无法新建数据库

Open wusongbai139 opened this issue 1 year ago • 1 comments

问题描述 / Problem Description 无法新建数据库

复现问题的步骤 / Steps to Reproduce 在建立数据库的时候,一直停留在建立页面上 微信图片_20240225132833 后台显示如下: INFO: 127.0.0.1:64178 - "POST /llm_model/list_config_models HTTP/1.1" 200 OK 2024-02-25 13:21:59,628 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_config_models "HTTP/1.1 200 OK" 2024-02-25 13:23:05,709 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/search_docs: timed out File "H:\agent\LBchat\webui_pages\knowledge_base\knowledge_base.py", line 329, in {"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"), TypeError: string indices must be integers2024-02-25 13:32:00,839 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/search_docs: timed out 2024-02-25 13:32:18,410 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/create_knowledge_base: timed out 2024-02-25 13:37:00,864 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/search_docs: timed out 2024-02-25 13:37:00.865 Uncaught app exceptionTraceback (most recent call last): File "H:\anaconda3\envs\chatchat\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "H:\agent\LBchat\webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "H:\agent\LBchat\webui_pages\knowledge_base\knowledge_base.py", line 328, in knowledge_base_page data = [ File "H:\agent\LBchat\webui_pages\knowledge_base\knowledge_base.py", line 329, in {"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"),TypeError: string indices must be integers2024-02-25 13:37:18,421 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/create_knowledge_base: timed out

环境信息 / Environment Information 操作系统:Windows-10-10.0.22621-SP0. python版本:3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] 项目版本:v0.2.10 langchain版本:0.0.354. fastchat版本:0.2.35

附加信息 / Additional Information 执行“python init_database.py --recreate-vs”没有问题的。

wusongbai139 avatar Feb 25 '24 05:02 wusongbai139

🤖

你好呀,@wusongbai139!很高兴再次见到你。希望你今天过得不错。

感谢您的反馈。根据您提供的日志,问题可能出在 /knowledge_base/search_docs/knowledge_base/create_knowledge_base 这两个请求上,它们都出现了超时错误。这可能是由于处理这些请求的函数在处理大量数据或执行复杂操作时,超出了预设的超时时间。

此外,日志中还出现了一个错误,提示“string indices must be integers”。这可能是由于在处理某个字符串时,尝试使用字符串作为索引,而不是整数。这可能是由于数据格式错误或代码中的一个错误。

关于 init_database.py 脚本,这个脚本主要用于管理和操作应用程序的数据库。在您的情况下,执行 python init_database.py --recreate-vs 没有问题,这意味着数据库的向量存储已经成功重建。

我建议您检查以下几点:

  1. 检查您的网络连接,确保服务器可以在预设的超时时间内响应请求。
  2. 检查您的数据格式,确保它们符合预期。特别是,检查是否有任何字符串被错误地用作索引。
  3. 如果可能,尝试减少请求的数据量或简化操作,以减少处理时间。

如果问题仍然存在,我建议您提供更多的信息,如详细的错误消息、代码片段或更详细的复现步骤,以便我们能更好地帮助您解决问题。

此外,我还找到了一些类似的已解决问题,可能对您有所帮助:

希望这些信息对您有所帮助。

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Feb 25 '24 05:02 dosubot[bot]

尝试一下本地行不行

zRzRzRzRzRzRzR avatar Mar 08 '24 02:03 zRzRzRzRzRzRzR

我也遇到这个问题了,但我用的就是本地的模型

INFO: loading vector store in '14/vector_store/bge-large-zh-v1.5' from disk. 2024-03-22 11:07:07,460 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/create_knowledge_base: timed out

lrn201 avatar Mar 22 '24 03:03 lrn201

我也遇到这个问题了,但我用的就是本地的模型

INFO: loading vector store in '14/vector_store/bge-large-zh-v1.5' from disk. 2024-03-22 11:07:07,460 - utils.py[line:95] - ERROR: ReadTimeout: error when post /knowledge_base/create_knowledge_base: timed out

我重新下载了模型,重新启动了几次就好了,具体原因还不知道为什么

lrn201 avatar Mar 22 '24 05:03 lrn201