YACWC
This commit is contained in:
35
update_qdrant.py
Normal file
35
update_qdrant.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from qdrant_client import QdrantClient
|
||||
from qdrant_client.http import models
|
||||
from qdrant_client.models import Distance, VectorParams
|
||||
|
||||
client = QdrantClient(host="localhost", port=6333)
|
||||
|
||||
collection_head = "nuggets_clip"
|
||||
collection_head = "nuggets_so400m"
|
||||
|
||||
|
||||
|
||||
for collection_name in [collection_head, collection_head +'_averaged']:
|
||||
try:
|
||||
client.create_collection(
|
||||
collection_name=collection_name,
|
||||
vectors_config=VectorParams(size=1152, distance=Distance.COSINE),
|
||||
on_disk_payload = True
|
||||
)
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name=collection_name,
|
||||
field_name="filepath",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
min_token_len=1,
|
||||
max_token_len=15,
|
||||
lowercase=True,
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
from prettyprinter import cpprint
|
||||
cpprint(client.get_collection(collection_name).dict()['vectors_count'])
|
||||
|
||||
Reference in New Issue
Block a user