Skip to content

Commit

Permalink
fix: Remove np.view for floatvector
Browse files Browse the repository at this point in the history
Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn committed Apr 23, 2024
1 parent ea2c9c6 commit 277c602
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/hello_milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# provide the pk field because `auto_id` is set to False
[str(i) for i in range(num_entities)],
rng.random(num_entities).tolist(), # field random, only supports list
rng.random((num_entities, dim)), # field embeddings, supports numpy.ndarray and list
rng.random((num_entities, dim), np.float32), # field embeddings, supports numpy.ndarray and list
]

insert_result = hello_milvus.insert(entities)
Expand Down
2 changes: 1 addition & 1 deletion pymilvus/orm/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def prepare_insert_data(
field.name, "np.float32/np.float64", f_data.dtype
)
)
d = f_data.view(np.float32).tolist()
d = f_data.tolist()

elif isinstance(f_data[0], np.ndarray):
for ndarr in f_data:
Expand Down

0 comments on commit 277c602

Please sign in to comment.