diff --git a/examples/hello_milvus.py b/examples/hello_milvus.py index 0cbb8f944..fcb475db7 100644 --- a/examples/hello_milvus.py +++ b/examples/hello_milvus.py @@ -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) diff --git a/pymilvus/orm/prepare.py b/pymilvus/orm/prepare.py index 5e2902a20..799fcad04 100644 --- a/pymilvus/orm/prepare.py +++ b/pymilvus/orm/prepare.py @@ -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: