Skip to content

Commit

Permalink
fix url in readme
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy committed Nov 14, 2024
1 parent a2224f3 commit 72a25ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<p align=center>
<a href="https://discord.gg/KqswhpVgdU"><img alt="discord invitation link" src="https://dcbadge.vercel.app/api/server/KqswhpVgdU?style=flat"></a>
<a href="https://twitter.com/TensorChord"><img src="https://img.shields.io/twitter/follow/tensorchord?style=social" alt="trackgit-views" /></a>
<a href="https://hub.docker.com/r/tensorchord/vcvec"><img src="https://img.shields.io/docker/pulls/tensorchord/vcvec" /></a>
<a href="https://github.com/tensorchord/vcvec#contributors-"><img alt="all-contributors" src="https://img.shields.io/github/all-contributors/tensorchord/vcvec/main"></a>
<a href="https://hub.docker.com/r/tensorchord/vchord-postgres"><img src="https://img.shields.io/docker/pulls/tensorchord/vchord-postgres" /></a>
<a href="https://github.com/tensorchord/VectorChord#contributors-"><img alt="all-contributors" src="https://img.shields.io/github/all-contributors/tensorchord/VectorChord/main"></a>
</p>

VectorChord (vchord) is a PostgreSQL extension designed for scalable, high-performance, and disk-efficient vector similarity search. It serves as the successor to the [pgvecto.rs](https://github.com/tensorchord/pgvecto.rs) project.
Expand Down
2 changes: 1 addition & 1 deletion scripts/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async def add_centroids(conn, name, centroids):
copy.set_types(["integer", "integer", "vector"])
await copy.write_row((0, None, root))
for i, centroid in tqdm(enumerate(centroids), desc="Adding centroids", total=n):
await copy.write_row((i+1, 0, centroid))
await copy.write_row((i + 1, 0, centroid))
while conn.pgconn.flush() == 1:
await asyncio.sleep(0)

Expand Down
8 changes: 6 additions & 2 deletions scripts/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def kmeans_cluster(
if n > MAX_POINTS_PER_CLUSTER * k and not mmap:
train = reservoir_sampling(iter(data), MAX_POINTS_PER_CLUSTER * args.lists)
elif n > MAX_POINTS_PER_CLUSTER * k and mmap:
reservoir_sampling_np(data, file_path, MAX_POINTS_PER_CLUSTER * args.lists, chunks)
reservoir_sampling_np(
data, file_path, MAX_POINTS_PER_CLUSTER * args.lists, chunks
)
train = np.array(
np.memmap(
"index.mmap",
Expand Down Expand Up @@ -196,6 +198,8 @@ def kmeans_cluster(
args.mmap,
args.chunks,
)
print(f"K-means (k=({args.lists}, {args.lists_2})): {perf_counter() - start_time:.2f}s")
print(
f"K-means (k=({args.lists}, {args.lists_2})): {perf_counter() - start_time:.2f}s"
)

np.save(Path(args.output), centroids, allow_pickle=False)

0 comments on commit 72a25ca

Please sign in to comment.