Skip to content
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

Local inference batch #862

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 4 additions & 9 deletions qdrant_client/async_qdrant_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ async def query_batch_points(
requests = self._resolve_query_batch_request(requests)
requires_inference = self._inference_inspector.inspect(requests)
if requires_inference and (not self.cloud_inference):
requests = [self._embed_models(request) for request in requests]
requests = self._embed_models(requests)
return await self._client.query_batch_points(
collection_name=collection_name,
requests=requests,
Expand Down Expand Up @@ -1501,10 +1501,7 @@ async def upsert(
)
requires_inference = self._inference_inspector.inspect(points)
if requires_inference and (not self.cloud_inference):
if isinstance(points, list):
points = [self._embed_models(point, is_query=False) for point in points]
else:
points = self._embed_models(points, is_query=False)
points = self._embed_models(points, is_query=False)
return await self._client.upsert(
collection_name=collection_name,
points=points,
Expand Down Expand Up @@ -1555,7 +1552,7 @@ async def update_vectors(
assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}"
requires_inference = self._inference_inspector.inspect(points)
if requires_inference and (not self.cloud_inference):
points = [self._embed_models(point, is_query=False) for point in points]
points = self._embed_models(points, is_query=False)
return await self._client.update_vectors(
collection_name=collection_name,
points=points,
Expand Down Expand Up @@ -1995,9 +1992,7 @@ async def batch_update_points(
assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}"
requires_inference = self._inference_inspector.inspect(update_operations)
if requires_inference and (not self.cloud_inference):
update_operations = [
self._embed_models(op, is_query=False) for op in update_operations
]
update_operations = self._embed_models(update_operations, is_query=False)
return await self._client.batch_update_points(
collection_name=collection_name,
update_operations=update_operations,
Expand Down
Loading
Loading