Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PGVECTOR的连接报错问题 #2534

Closed
gforcefan opened this issue Jan 3, 2024 · 1 comment
Closed

[BUG] PGVECTOR的连接报错问题 #2534

gforcefan opened this issue Jan 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gforcefan
Copy link

'PGVector' object has no attribute 'connect'

进行初始化pg数据库时,报出'PGVector' object has no attribute 'connect'
执行python init_database.py --recreate-vs 后,报出'PGVector' object has no attribute 'connect'
如图
Snipaste_2024-01-03_14-40-48

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:v0.2.9
  • 是否使用 Docker 部署(是/否):否
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等):ChatGLM3-6B
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):bge-large-zh
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): pg_vector,
  • 操作系统及版本 / Operating system and version: ubuntu20.04
  • Python 版本 / Python version: 3.10.12
  • 其他相关环境信息 / Other relevant environment information: 以github/Langchain-Chatchat/requirements.txt为主,
  • langchain版本 0.0.352
  • psycopg2版本 2.9.9
  • pgvector版本 0.2.4

原因
langchain的版本更新后,PGVector类的connect函数已替换为_create_engine
Snipaste_2024-01-03_15-06-10

修改建议
对报错内代码进行修改后
Snipaste_2024-01-03_14-53-12

完成初始化及数据导入
Snipaste_2024-01-03_15-00-52

@gforcefan gforcefan added the bug Something isn't working label Jan 3, 2024
Copy link

dosubot bot commented Jan 3, 2024

🤖

It's great to see that you've identified the issue and even provided a suggested fix for the problem. Your detailed explanation and proposed changes will be very helpful for the Langchain-Chatchat project.

I encourage you to go ahead and create a pull request with your proposed changes. The maintainers will review it and decide if the changes should be merged into the codebase.

Thank you for your contribution to Langchain-Chatchat!


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.

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
@zRzRzRzRzRzRzR zRzRzRzRzRzRzR self-assigned this Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants