Skip to content

Commit

Permalink
Update embedding.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xusenlinzy committed Apr 27, 2024
1 parent 6e60de5 commit a70de4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/rag/models/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def embed(
vecs = np.c_[vecs, zeros]
elif 0 < dimensions < dim:
vecs = vecs[..., :dimensions] # Shrink the embedding dimensions
vecs = normalize_embeddings(vecs).numpy()
vecs = normalize_embeddings(vecs).cpu().numpy()

if encoding_format == "base64":
vecs = [base64.b64encode(v.tobytes()).decode("utf-8") for v in vecs]
Expand Down

0 comments on commit a70de4b

Please sign in to comment.