Langchain-Chatchat
Langchain-Chatchat copied to clipboard
[BUG] 与milvus整合时页面出现点击异常
LangchainChatChat 0.2.9 milvus 2.3.4 pymilvus 2.3.4
集成后在webui上点击知识库中某个文件后,出现红色报错:
🤖
你好,@AlexNilone!我是 Dosu,一个机器人,我可以帮助你解决bug,回答问题,甚至成为贡献者。当你等待人类维护者的响应时,我会在这里帮助你。我正在查看你的问题,很快会给你一个完整的答案。
我发现在上传文件加入知识库的过程中服务日志也有报错(但是最终是录入进去了的),和数值转换精度有关
我用faiss数据库也有这个问题,这个bug应该和用的哪个数据库无关
🤖
您在webui上点击知识库中的文件时遇到的红色错误可能是因为在server/knowledge_base/kb_doc_api.py
文件中,files2docs
函数目前被注释掉了。这个函数负责将文件转换为文档并保存到知识库。由于它被注释掉,应用程序可能无法在知识库中找到文件,因此出现错误。
关于在文件上传过程中出现的与数值转换精度有关的错误,没有更多信息很难说。但是,它可能与您文件中的字段的数据类型有关。如果一个字段预期是某种数值类型(如整数或浮点数),而文件中的数据无法转换为该类型,您可能会看到错误。
请注意,这些只是基于提供的上下文的可能解释。要更准确的诊断,需要更多关于确切的错误消息和您文件中的数据的信息。
源代码:
关于在webui上点击知识库中的文件时显示的红色错误的确切错误消息,提供的上下文中并未明确提到。然而,根据代码中的不同条件,可能会显示几个错误消息。以下是一些例子:
-
如果在获取知识库详情时出现异常,会显示以下错误消息:"获取知识库信息错误,请检查是否已按照
README.md
中4 知识库初始化与迁移
步骤完成初始化或迁移,或是否为数据库连接错误。" -
如果在创建新的知识库时,知识库名称为空或已存在,分别会显示以下错误消息:"知识库名称不能为空!" 和 "名为 {kb_name} 的知识库已经存在!"
-
如果
api.upload_kb_docs
函数返回错误消息,它会作为一个toast消息显示。
然而,没有具体的错误场景或更多的上下文,无法提供在webui上点击知识库中的文件时会显示的确切错误消息。
源代码:
如果您能提供更多的错误详情或者是错误的复现步骤,我将能更好地帮助您解决问题。
Sources
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.
🤖
您在webui上点击知识库中的文件时遇到的红色错误可能是因为在
server/knowledge_base/kb_doc_api.py
文件中,files2docs
函数目前被注释掉了。这个函数负责将文件转换为文档并保存到知识库。由于它被注释掉,应用程序可能无法在知识库中找到文件,因此出现错误。关于在文件上传过程中出现的与数值转换精度有关的错误,没有更多信息很难说。但是,它可能与您文件中的字段的数据类型有关。如果一个字段预期是某种数值类型(如整数或浮点数),而文件中的数据无法转换为该类型,您可能会看到错误。
请注意,这些只是基于提供的上下文的可能解释。要更准确的诊断,需要更多关于确切的错误消息和您文件中的数据的信息。
源代码:
* [server/knowledge_base/kb_doc_api.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/knowledge_base/kb_doc_api.py)
关于在webui上点击知识库中的文件时显示的红色错误的确切错误消息,提供的上下文中并未明确提到。然而,根据代码中的不同条件,可能会显示几个错误消息。以下是一些例子:
1. 如果在获取知识库详情时出现异常,会显示以下错误消息:"获取知识库信息错误,请检查是否已按照 `README.md` 中 `4 知识库初始化与迁移` 步骤完成初始化或迁移,或是否为数据库连接错误。" 2. 如果在创建新的知识库时,知识库名称为空或已存在,分别会显示以下错误消息:"知识库名称不能为空!" 和 "名为 {kb_name} 的知识库已经存在!" 3. 如果 `api.upload_kb_docs` 函数返回错误消息,它会作为一个toast消息显示。
然而,没有具体的错误场景或更多的上下文,无法提供在webui上点击知识库中的文件时会显示的确切错误消息。
源代码:
* [webui_pages/knowledge_base/knowledge_base.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/webui_pages/knowledge_base/knowledge_base.py)
如果您能提供更多的错误详情或者是错误的复现步骤,我将能更好地帮助您解决问题。
Sources
* [server/knowledge_base/kb_doc_api.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/knowledge_base/kb_doc_api.py) * [webui_pages/knowledge_base/knowledge_base.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/webui_pages/knowledge_base/knowledge_base.py)
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.
没有解决。我看这个问题也有别人提出,希望能跟进测下
🤖
我明白您的困扰,我会尽力帮助您解决这个问题。首先,我需要更多的信息来更好地理解您遇到的问题。
关于files2docs
函数被注释的问题,我需要查看该函数的具体实现以了解其功能。如果可能的话,您能提供一下该函数的代码吗?
关于在webui上点击知识库中的文件时显示的红色错误,我需要知道具体的错误消息。您能提供一下错误消息的截图或者是错误消息的文本吗?
关于文件上传过程中出现的与数值转换精度有关的错误,我需要知道更多的信息。您能提供一下服务日志中的错误消息吗?这将有助于我理解问题的原因。
如果您能提供以上信息,我将能更好地帮助您解决问题。同时,我也会关注这个问题,看看是否有其他用户遇到了类似的问题。
Sources
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.
机器人回复没帮助
🤖
It seems like this issue requires a deeper look, @imClumsyPanda could you please lend your expertise?
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.
这个问题在0.2.10修复了,你拉一下最新的分支
这个问题在0.2.10修复了,你拉一下最新的分支
0.2.10并未解决。
看起来不止是milvus,我看到milvus的repo里你创建了这个issue @AlexNilone ,正好我最近升级0.2.10也遇到这个问题,实在解决不了。
就在刚才,换了pgvector:看起来应该是向量化以后的代码逻辑问题
2024-01-29 21:19:14.733 Uncaught app exception
Traceback (most recent call last):
File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.dict)
File "/Users/colin/Documents/Source/Langchain-Chatchat/webui.py", line 64, in
LangchainChatChat 0.2.9 milvus 2.3.4 pymilvus 2.3.4
集成后在webui上点击知识库中某个文件后,出现红色报错:
请问解决了吗? 我们问题一样
这个问题在0.2.10修复了,你拉一下最新的分支
2.10.0还是报错,刚刚试了,还有就是,删除这个向量库,返回200说返回成功,但我查milvus向量库里面并没有删除成功,导致知识库问答中会回答之前删除了的内容
没有解决。
这个问题在0.2.10修复了,你拉一下最新的分支
2.10.0还是报错,刚刚试了,还有就是,删除这个向量库,返回200说返回成功,但我查milvus向量库里面并没有删除成功,导致知识库问答中会回答之前删除了的内容
情况基本一样。
看起来不止是milvus,我看到milvus的repo里你创建了这个issue @AlexNilone ,正好我最近升级0.2.10也遇到这个问题,实在解决不了。 就在刚才,换了pgvector:看起来应该是向量化以后的代码逻辑问题 2024-01-29 21:19:14.733 Uncaught app exception Traceback (most recent call last): File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script exec(code, module.dict) File "/Users/colin/Documents/Source/Langchain-Chatchat/webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "/Users/colin/Documents/Source/Langchain-Chatchat/webui_pages/knowledge_base/knowledge_base.py", line 328, in knowledge_base_page data = [ ^ File "/Users/colin/Documents/Source/Langchain-Chatchat/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 integers, not 'str' ERROR: Exception in ASGI application Traceback (most recent call last): File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context self.dialect.do_execute( File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute cursor.execute(statement, parameters) psycopg2.errors.SyntaxError: syntax error at or near "ARRAY" LINE 1: ...ROM langchain_pg_embedding WHERE collection_id in ARRAY['fed...
0.2.9和0.2.10 都报错
一模一样的情况,请问解决了吗
看起来不止是milvus,我看到milvus的repo里你创建了这个issue @AlexNilone ,正好我最近升级0.2.10也遇到这个问题,实在解决不了。 就在刚才,换了pgvector:看起来应该是向量化以后的代码逻辑问题 2024-01-29 21:19:14.733 Uncaught app exception Traceback (most recent call last): File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script exec(code, module.dict) File "/Users/colin/Documents/Source/Langchain-Chatchat/webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "/Users/colin/Documents/Source/Langchain-Chatchat/webui_pages/knowledge_base/knowledge_base.py", line 328, in knowledge_base_page data = [ ^ File "/Users/colin/Documents/Source/Langchain-Chatchat/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 integers, not 'str' ERROR: Exception in ASGI application Traceback (most recent call last): File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context self.dialect.do_execute( File "/Users/colin/miniforge3/envs/chatchat/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute cursor.execute(statement, parameters) psycopg2.errors.SyntaxError: syntax error at or near "ARRAY" LINE 1: ...ROM langchain_pg_embedding WHERE collection_id in ARRAY['fed...
你好,我遇到了和你一模一样的问题,请问你解决了嘛
一模一样的情况,请问解决了吗
你好,请问你解决了嘛
一模一样的情况,请问解决了吗
你好,请问你解决了嘛
还没有
一模一样的情况,请问解决了吗
你好,请问你解决了嘛
还没有
你好,我按照以下方式修改,解决了
将collection_id改为custom_id,将results语句中的ids外加tuple
我的langchain-chat版本是v0.2.9
一模一样的情况,请问解决了吗
你好,请问你解决了嘛
还没有
你好,我按照以下方式修改,解决了
将collection_id改为custom_id,将results语句中的ids外加tuple 我的langchain-chat版本是v0.2.9
有其他修改吗,是不是只用改这一处呀
Reference
我向量库用的是pgvector,只改了pg_kb_service.py的这段代码
Reference
我向量库用的是pgvector,只改了pg_kb_service.py的这段代码
老哥,如果用milvus向量库,要怎么改呀
感觉也是类似的,你看看collection_id是不是mivlus库里也没有,也是custom_id
---原始邮件--- 发件人: @.> 发送时间: 2024年3月4日(周一) 下午2:41 收件人: @.>; 抄送: @.@.>; 主题: Re: [chatchat-space/Langchain-Chatchat] [BUG] 与milvus整合时页面出现点击异常 (Issue #2761)
Reference
我向量库用的是pgvector,只改了pg_kb_service.py的这段代码
老哥,如果用milvus向量库,要怎么改呀
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
最新代码已经修复了
一模一样的情况,请问解决了吗 你好,请问怎么解决
最新代码已经修复了
怎么修改milvus呀,除了kb_config里面还有哪里需要修改呀
最新代码已经修复了
怎么修改milvus呀,除了kb_config里面还有哪里需要修改呀
按wiki里的步骤来,拉最新的代码就行了,应该不用改其他的