Skip to content

Commit

Permalink
target migration
Browse files Browse the repository at this point in the history
load redis dummy data
  • Loading branch information
alex-nork committed Jul 13, 2023
1 parent c6fe339 commit 9a3d93f
Show file tree
Hide file tree
Showing 3 changed files with 1,575 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chirps/base_app/management/commands/load_redis_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def add_arguments(self, parser):
def write_docs(pipe: redis.client.Pipeline, documents: list[dict], vector_field_name: str) -> None:
"""Write the documents to the redis database."""
for doc in documents:
embedding = np.array(doc['embedding'], dtype=np.float32).tobytes()
embedding = np.array(doc['embeddings'], dtype=np.float32).tobytes()
metadata = {vector_field_name: embedding}
pipe.hset(doc['id'], mapping=metadata) # type: ignore

Expand Down
Loading

0 comments on commit 9a3d93f

Please sign in to comment.