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] [KAG] 执行example里的例子时报错:Index query vector has 1536 dimensions, but indexed vectors have 1024. #293

Open
1 of 2 tasks
zzyyll2 opened this issue Jan 17, 2025 · 5 comments

Comments

@zzyyll2
Copy link

zzyyll2 commented Jan 17, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

Linux

What happened

使用dev/release里的docker-compose启动四个服务后,登录UI修改密码,配置了全局参数,在页面上上传知识都是正常的。
当使用KAG里的example/baike或medicine时报相同的错误:
报错步骤是 cd builder && python indexer.py:
org.neo4j.driver.exceptions.ClientException: Failed to invoke procedure db.index.vector.queryNodes: Caused by: java.lang.IllegalArgumentException: Index query vector has 1536 dimensions, but indexed vectors have 1024.

How to reproduce

git clone kag

  1. cd example/baike
  2. 修改kag_config.yaml
  3. knext project restore .
  4. knext schema commit
  5. cd builder && python indexer.py 此步出错:
  6. org.neo4j.driver.exceptions.ClientException: Failed to invoke procedure db.index.vector.queryNodes: Caused by: java.lang.IllegalArgumentException: Index query vector has 1536 dimensions, but indexed vectors have 1024.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@caszkgui
Copy link
Collaborator

  • 修改kag_config.yaml

Image

@zzyyll2
Copy link
Author

zzyyll2 commented Jan 17, 2025

kag_config.yaml已经修改过了,如下:

Image

@zzyyll2
Copy link
Author

zzyyll2 commented Jan 17, 2025

原因找到了,是接口没有传递dimensions导致的,请问这里为什么不传递demensions呢?

Image

@zzyyll2 zzyyll2 closed this as completed Jan 17, 2025
@zzyyll2 zzyyll2 reopened this Jan 17, 2025
@xionghuaidong
Copy link
Collaborator

xionghuaidong commented Jan 21, 2025

原因找到了,是接口没有传递dimensions导致的,请问这里为什么不传递demensions呢?

Image

The vector dimensions of the text-embedding-ada-002 model is 1536 and fixed. It's not a parameter.

@zzyyll2
Copy link
Author

zzyyll2 commented Jan 21, 2025

好的,我懂了,vector_dimensions的值要与model值对应,这个tips希望能录入到文档里,避免大家走弯路,谢谢。

Image

如上图所示,假如我用text-embedding-3-large,这个维度是可变的,最小512,最大3072,如果使用这个模型的话,是设置vector_dimensions这个就可以了吗?我能把这个值设置成512吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants