Skip to content

Added separate force vectors to ram switch to qdrant store. #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions datapipe/store/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(
collection_params: CollectionParams,
index_schema: Optional[dict] = None,
api_key: Optional[str] = None,
force_vectors_to_ram: Optional[bool] = True,
):
super().__init__()
self.name = name
Expand All @@ -67,6 +68,7 @@ def __init__(
self.inited = False
self.client: Optional[QdrantClient] = None
self._api_key = api_key
self.force_vectors_to_ram = force_vectors_to_ram

pk_columns = [column for column in self.schema if column.primary_key]

Expand All @@ -93,6 +95,9 @@ def __init_collection(self):
self.client.get_collection(self.name)
except UnexpectedResponse as e:
if e.status_code == 404:
if self.force_vectors_to_ram:
self.collection_params.vectors.on_disk = False

self.client.http.collections_api.create_collection(
collection_name=self.name, create_collection=self.collection_params
)
Expand Down
Loading