Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Resolve #72 Fix qdrant collection creation need optimizer #76

Open
wants to merge 2 commits into
base: main
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
7 changes: 6 additions & 1 deletion modules/streaming_pipeline/streaming_pipeline/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from bytewax.outputs import DynamicOutput, StatelessSink
from qdrant_client import QdrantClient
from qdrant_client.http.api_client import UnexpectedResponse
from qdrant_client.http.models import Distance, VectorParams
from qdrant_client.http.models import Distance, VectorParams, OptimizersConfigDiff
from qdrant_client.models import PointStruct

from streaming_pipeline import constants
Expand Down Expand Up @@ -46,6 +46,11 @@ def __init__(
vectors_config=VectorParams(
size=self._vector_size, distance=Distance.COSINE
),
# Manually add this optimizers_config to address issue: https://github.com/iusztinpaul/hands-on-llms/issues/72
# qdrant_client.http.exceptions.ResponseHandlingException: 1 validation error for ParsingModel[InlineResponse2005] (for parse_as_type)
# obj -> result -> config -> optimizer_config -> max_optimization_threads
# none is not an allowed value (type=type_error.none.not_allowed)
optimizers_config=OptimizersConfigDiff(max_optimization_threads=1),
)

def build(self, worker_index, worker_count):
Expand Down