-
Notifications
You must be signed in to change notification settings - Fork 33
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
What are dimensions? #98
Comments
you are correct that the dimension should be 1536 in this case but I'd suggest trying a different collection name that doesn't already exist and seeing if that resolves the issue |
@olirice look into my code sample please. I choose different collection I investigated little bit more. Library always query schema |
correct, the
the issue is that you manually ran the code create table documents (
id bigserial primary key,
content text, -- corresponds to Document.pageContent
metadata jsonb, -- corresponds to Document.metadata
embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed
); you can skip that step entirely. If this select
relname as table_name,
atttypmod as embedding_dim
from
pg_class pc
join pg_attribute pa
on pc.oid = pa.attrelid
where
pc.relnamespace = 'vecs'::regnamespace
and pc.relkind = 'r'
and pa.attname = 'vec'
and not pc.relname ^@ '_'
and pc.relname = 'documents' is returning embedding vector(3) I suspect what has happened is that you
To resolve that, go into your supabase project (note, this will delete any existing vecs data) and run drop schema vecs cascade; Once you've done that, you can start over with client = vecs.create_client(connection_uri)
collection = client.get_or_create_collection(name='documents', dimension=1536) |
@olirice I can see that it is expected behavior. Ok, but I have filled DB at this moment. And it was created according to Supabase manuals with the PS: Actually, I used |
Describe the bug
I have standard document table in Supabase:
My vecs code:
This code raises an MismatchedDimension in Collection._create_if_not_exists function. It says that 3 is not equal to 1536.
This function executes query
and it returns 3. But if you look into my table there is no number 3 at all. If one wishes to get size of vector should use
May be I do not understand what is dimension for vecs collection. So, please, explain.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect correct obtaining of the collection.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions:
The text was updated successfully, but these errors were encountered: