Git Product home page Git Product logo

Comments (7)

KShivendu avatar KShivendu commented on September 27, 2024 1

Ahh I see. We will fix this soon.

@dabasmoti you can try using our client-server implementation which we anyways recommend for production. It works fine. Just use:

client = QdrantClient('localhost')

from qdrant-client.

dabasmoti avatar dabasmoti commented on September 27, 2024 1

Yep,
you are right.
It does work with the server.

from qdrant-client.

agourlay avatar agourlay commented on September 27, 2024 1

I took the liberty to transfer the issue to the qdrant Python client repository.

from qdrant-client.

joein avatar joein commented on September 27, 2024 1

Hi @dabasmoti

We have a bug on our side.
In case you need to use local mode and don't want to wait for the release, you can sort indices and corresponding values before vector creation, e.g.:

OK:

SparseVector(
    indices=[0, 5],
    values=[0.3, 0.2]
)

ERROR:

SparseVector(
    indices=[5, 0],
    values=[0.2, 0.3]
)

from qdrant-client.

KShivendu avatar KShivendu commented on September 27, 2024

Good catch. I think you can do this in the meantime to make it work.

client.upsert(
    collection_name=COLLECTION_NAME,
    points=[
        models.PointStruct(
            id=1,
            payload={},  # Add any additional payload if necessary
            vector={
                "text": models.SparseVector(
                    indices=np.array([1479876206, 696618268]),
                    values=np.array([0.5, 0.6])
                )
            },
        )
    ],
)

@joein @agourlay Please have a look

It happens because in the source code sorted_indices is a list and arr[list_of_indices_to_extract] works with numpy arrays but not python arrays. Here sorted_indices = [0, 1] and vector.indices = [1479876206, 696618268].

We need to fix local mode implementation for this. I think client-server mode works fine.

from qdrant-client.

dabasmoti avatar dabasmoti commented on September 27, 2024

@KShivendu
I tried it before.
It doesn't solve it.
same error

from qdrant-client.

joein avatar joein commented on September 27, 2024

available as of qdrant-client==1.7.1

from qdrant-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.