File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
apps/docs/pages/guides/ai/examples Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def seed():
9797
9898 # add records to the *images* collection
9999 images.upsert(
100- vectors = [
100+ records = [
101101 (
102102 " one.jpg" , # the vector's identifier
103103 img_emb1, # the vector. list or np.array
@@ -142,7 +142,7 @@ With Supabase Vector we can easily query our embeddings. We can use either an im
142142def search ():
143143 # create vector store client
144144 vx = vecs.create_client(DB_CONNECTION )
145- images = vx.get_collection (name = " image_vectors" )
145+ images = vx.get_or_create_collection (name = " image_vectors" , dimension = 512 )
146146
147147 # Load CLIP model
148148 model = SentenceTransformer(' clip-ViT-B-32' )
@@ -152,7 +152,7 @@ def search():
152152
153153 # query the collection filtering metadata for "type" = "jpg"
154154 results = images.query(
155- query_vector = text_emb, # required
155+ data = text_emb, # required
156156 limit = 1 , # number of records to return
157157 filters = {" type" : {" $eq" : " jpg" }}, # metadata filters
158158 )
You can’t perform that action at this time.
0 commit comments