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

[BUG] 上传文件后,知识库文件加载失败

Open SilentTE opened this issue 1 year ago • 1 comments

问题描述 / Problem Description 上传文件后,分词器未显示,源文件及向量库也显示为x Dingtalk_20240229091426

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:v0.2.10
  • 是否使用 Docker 部署(是/否):否
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等): ChatGLM3-6B
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):bge-large-zh-v1.5
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss
  • 操作系统及版本 / Operating system and version: window 11
  • Python 版本 / Python version:3.11.7
  • 其他相关环境信息 / Other relevant environment information:

附加信息 / Additional Information 是我哪个依赖包少安装了吗

SilentTE avatar Feb 29 '24 01:02 SilentTE

🤖

你好,@SilentTE!很高兴再次遇见你。🌟

根据我在Langchain-Chatchat仓库中找到的相关问题,这个问题可能与缺少或者错误加载依赖包有关。具体来说,日志条目:

  • "No sentence-transformers model found with name C:\\Users\\Administrator/.cache\\torch\\sentence_transformers\\GanymedeNil_text2vec-large-chinese. Creating a new one with MEAN pooling."(来自第一个JSONL块)
  • "ModuleNotFoundError: No module named 'modelscope'"(来自第二个JSONL块)

这些提示表明,系统在寻找特定的句子转换模型时失败了,导致创建了一个新的模型。这可能意味着预期的模型没有被安装,或者没有在预期的目录中找到,这是一个依赖问题。第二个日志条目明确提到了ModuleNotFoundError,这证实了一个必需的模块(modelscope)没有找到,表明缺少依赖。

因此,你在上传文件后,分词器未显示,源文件及向量库也显示为x的问题,很可能源于这些缺失的依赖。确保所有必需的模型和模块都正确安装并且对Langchain-Chatchat可访问,应该是解决这个问题的第一步。

另外,我在Langchain-Chatchat的问题记录中找到了两个类似的已解决问题,可能对你有所帮助:

  1. v0.2.10 版本添加到向量库的条目显示可能有问题 最后更新于2024年2月24日。这个问题的建议解决方案是在knowledge_base.py中注释掉202和203行。这个建议没有得到正面或负面的反馈,所以可能值得考虑作为一个潜在的解决方案。

  2. [BUG] 上传知识库文件无法向量化 最后更新于2024年2月13日。这个问题的建议解决方案是在上传知识库文件后,你应该明确调用recreate_vector_store端点来向量化你的文档。这个端点负责根据内容中的文档重建向量库。这里有一段可能相关的代码:

app.post("/knowledge_base/recreate_vector_store",
         tags=["Knowledge Base Management"],
         summary="根据content中文档重建向量库,流式输出处理进度。"
         )(recreate_vector_store)

你可以在源文件中找到更多的细节:

希望这些信息能对你有所帮助。如果你有更多的问题或者需要进一步的帮助,请随时告诉我。

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 29 '24 01:02 dosubot[bot]

这个问题已经被标记为 stale ,因为它已经超过 30 天没有任何活动。

github-actions[bot] avatar Apr 01 '24 21:04 github-actions[bot]