diff --git a/README.md b/README.md index f70049e..b0d94f6 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ import towhee from towhee import ops p = ( - towhee.pipe.inputs('vec') + towhee.pipe.input('vec') .map('vec', (), ops.ann_insert.milvus_client(host='127.0.0.1', port='19530', collection_name='test_collection')) .output() ) diff --git a/milvus_client.py b/milvus_client.py index 4f07a85..637e5ca 100644 --- a/milvus_client.py +++ b/milvus_client.py @@ -43,7 +43,7 @@ class MilvusClient(PyOperator): else: row.append([item]) mr = self._collection.insert(row) - if mr.err_count > 0: + if mr.insert_count != len(row[0]): raise RuntimeError("Insert to milvus failed") return mr