qdrant / qdrant-client

Python client for Qdrant vector search engine
https://qdrant.tech
Apache License 2.0
750 stars 121 forks source link

Data validation and `upload_collection` method #17

Open rushter opened 2 years ago

rushter commented 2 years ago

I think the upload_collection method should validate data before uploading it.

For example, it will silently upload 1 million records where vector_size=256 to a collection where vector_size=512. As a result, you get no errors and no data will be added to a collection.

Comparing the vector size of a collection to the input array size is very cheap.

arestifo commented 1 year ago

Just ran into the silent fail issue, I'm surprised the Python client doesn't report an error here. I see a warning in the Qdrant Docker logs but nothing is wrong from the Python side: [2023-05-08T21:58:47.845Z WARN collection::collection_manager::collection_updater] Update operation declined: Wrong input: Vector inserting error: expected dim: 128, got 1536

generall commented 1 year ago

it might happen if you use wait=false in upsert API

zeynepiskndr commented 1 year ago

Just ran into the silent fail issue, I'm surprised the Python client doesn't report an error here. I see a warning in the Qdrant Docker logs but nothing is wrong from the Python side: [2023-05-08T21:58:47.845Z WARN collection::collection_manager::collection_updater] Update operation declined: Wrong input: Vector inserting error: expected dim: 128, got 1536

I have the same problem, I would appreciate it if you could help. I am working with the Google Cloud Server and I came across this error in Notepad. UnexpectedResponse: Unexpected Response: 400 (Bad Request) Raw response content: b'{"status":{"error":"Wrong input: Vector inserting error: expected dim: 734, got 0"},"time":0.002494573}'

kientv commented 9 months ago

I'm hitting this error: grpc_message:"Wrong input: Vector inserting error: expected dim: 1536, got 768"

joein commented 9 months ago

I'm hitting this error: grpc_message:"Wrong input: Vector inserting error: expected dim: 1536, got 768"

it means that you are trying to upload 768-d vectors to a collection which has been configured to work with 1536-d vectors

AI-Aether commented 9 months ago

Is there a fix? Even setting wait=True is not solving this issue

kientv commented 9 months ago

That's not Qdrant's problem. You can solve that error by deleting old collection and create a new collection with correct dimension size. for instance: OpenAI embedding is 1536, Gemini is 768.