Commit 680d0550 authored by zhengyaoqiu's avatar zhengyaoqiu

优化

parent 160369c6
...@@ -11,8 +11,8 @@ class TestCreateCollectionFunction(unittest.TestCase): ...@@ -11,8 +11,8 @@ class TestCreateCollectionFunction(unittest.TestCase):
fields: List[FieldSchema] = [ fields: List[FieldSchema] = [
FieldSchema(name="image", dtype=DataType.VARCHAR, max_length=256, is_primary=True, auto_id=False), FieldSchema(name="image", dtype=DataType.VARCHAR, max_length=256, is_primary=True, auto_id=False),
FieldSchema(name="key", dtype=DataType.VARCHAR, max_length=256), FieldSchema(name="key", dtype=DataType.VARCHAR, max_length=256),
# FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=512) # CLIP ViT-B/32的特征维度为512 FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=512) # CLIP ViT-B/32的特征维度为512
FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=768) # CLIP ViT-L/14@336px的特征维度为512 # FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=768) # CLIP ViT-L/14@336px的特征维度为512
] ]
MilvusClient().connect().create_collection("pc3", fields, "PC3 图片向量存储") MilvusClient().connect().create_collection("pc3", fields, "PC3 图片向量存储")
...@@ -20,7 +20,7 @@ class TestCreateCollectionFunction(unittest.TestCase): ...@@ -20,7 +20,7 @@ class TestCreateCollectionFunction(unittest.TestCase):
index_params = { index_params = {
"index_type": "HNSW", "index_type": "HNSW",
"metric_type": "IP", # 内积相似度 "metric_type": "IP", # 内积相似度
"params": {"M": 16, "efConstruction": 200} "params": {"M": 32, "efConstruction": 400}
} }
MilvusClient().connect().create_index("pc3", "vector", index_params) MilvusClient().connect().create_index("pc3", "vector", index_params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment