Giter Site home page Giter Site logo

Comments (1)

dosubot avatar dosubot commented on August 16, 2024 2

To specify the datatype Float16 for embeddings in the Milvus vector store, you need to modify the collection creation parameters to include the desired datatype. However, the current implementation of the MilvusVectorStore class in LlamaIndex does not directly support setting the datatype for embeddings to Float16. The pymilvus library version used in LlamaIndex only supports float32 for vector fields [1].

Here's how you can modify the MilvusVectorStore class to specify the datatype for embeddings, assuming future support for Float16:

from pymilvus import DataType

# Modify the collection creation to include the datatype
self.milvusclient.create_collection(
    collection_name=self.collection_name,
    dimension=self.dim,
    primary_field_name=MILVUS_ID_FIELD,
    vector_field_name=self.embedding_field,
    id_type="string",
    metric_type=self.similarity_metric,
    max_length=65_535,
    consistency_level=self.consistency_level,
    fields=[
        {"name": self.embedding_field, "type": DataType.FLOAT_VECTOR, "params": {"dim": self.dim, "dtype": "float16"}},
        {"name": MILVUS_ID_FIELD, "type": DataType.INT64, "is_primary": True},
        # Add other fields as necessary
    ]
)

Please note that you need to ensure that both the pymilvus library and the Milvus server version you are using support the float16 datatype. As of now, the pymilvus library version used in LlamaIndex does not support float16 for vector fields [2][1].

To continue talking to Dosu, mention @dosu.

from llama_index.

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.