Skip to content

Commit 3786aa5

Browse files
shonenadacharislam
andauthored
Update document image-search-openai-clip.mdx (supabase#17621)
* Update document image-search-openai-clip.mdx Update document for breaking changes. * Update apps/docs/pages/guides/ai/examples/image-search-openai-clip.mdx --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
1 parent 554ffd7 commit 3786aa5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/docs/pages/guides/ai/examples/image-search-openai-clip.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
142142
def 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
)

0 commit comments

Comments
 (0)