Find answers from the community

Updated 9 months ago

Hey folks! I'm using llamaindex with

At a glance

The community member is using llamaindex with pgvector and text-embedding-large-3 with an embedding size of 1536. They are encountering an error when using the vector store, as the expected dimensions are 3072 but the embeddings are 1536. Another community member suggests swapping to ada-2, which works but produces incorrect results. The community members discuss that there may be a hardcoded 3072 dimension size somewhere, and confirm that the embeddings are stored with 1536 dimensions. A solution is provided to set the embed_dim to 3072 in the PGVectorStore, which resolves the initial error. However, the community member then encounters a new issue where the process stops mid-generation and gives an error, with no information in the backend logs. They ask for suggestions on where to look to resolve this new issue.

Hey folks! I'm using llamaindex with pgvector. I'm usiong text-embedding-large-3 with embedding size of 1536.
When using the vector store and asking a question, I get this error:
sqlalchemy.exc.StatementError: (builtins.ValueError) expected 1536 dimensions, not 3072
This is odd because embedding with 3072 doesn't work with pgvector due to postgres max dimensions. I'm assuming that there must be a dimension size that is hardcoded somewhere? Does anyone have a similar issue?
0
L
9 comments
in env file:
Attachment
image.png
Swapping to ada-2 works, even though a different embedding model was used to embed it. The results are wrong, but at least it doesn't give an error. I'm assuming there is a hardcoded 3072 somewhere for what it is expecting. But we can actually use 1536 dimensions with embedding-3-large. Any thoughts, friends?
I can confirm that the embeddings are stored with 1536 dimensions
You need to set the embed dim

PGVectorStore(..., embed_dim=3072)
Thanks @Logan M that worked. But now I'm running into this problem which happened with other dimensions too:
Basically mid-generation it just stops and gives an error. The backend logs don't show anything:
Attachment
image.png
Is this a known issue? Could you throw some pointers at where I should look to resolve this? Thanks πŸ™‚ @Logan M
It might be easier to debug if you console logged the error instead of trying to parse it
Add a reply
Sign up and join the conversation on Discord