Giter Site home page Giter Site logo

Comments (4)

yanliang567 avatar yanliang567 commented on July 16, 2024

/assign @jaelgu
could you please help to take a look?
@yoke233 are you running on milvus lite?
/unassign

from milvus.

yoke233 avatar yoke233 commented on July 16, 2024

milvus running on docker compose

it may be MilvusDocumentStore's bug

from milvus.

jaelgu avatar jaelgu commented on July 16, 2024

Forwarded to Milvus-haystack repo: milvus-io/milvus-haystack#29

from milvus.

zc277584121 avatar zc277584121 commented on July 16, 2024

@yoke233 can you try this demo, which excludes other interfering factors

import time

from milvus_haystack import MilvusEmbeddingRetriever, MilvusDocumentStore
from haystack import Document

DEFAULT_CONNECTION_ARGS = {
    # "uri": "http://localhost:19530",  # This uri works for Milvus docker service
    "uri": "./milvus_test.db",  # This uri works for Milvus Lite
}

document_store = MilvusDocumentStore(  # or any other vector db instance
    connection_args=DEFAULT_CONNECTION_ARGS,
    consistency_level="Strong",
    drop_old=True,
)


def run(document_store: MilvusDocumentStore):
    documents = []
    doc = Document(
        content="A Foo Document",
        meta={
            "name": "name_0",
            "page": "100",
            "chapter": "intro",
            "number": 2,
            "date": "1969-07-21T20:17:40",
        },
        embedding=[-10.0] * 128,
    )

    for i in range(1000):
        documents.append(doc)
    t0 = time.time()
    document_store.write_documents(documents)
    t1 = time.time()
    print(f"Time to write documents: {t1 - t0} seconds")

    # retriever = MilvusEmbeddingRetriever(
    #     document_store,
    # )
    # query_embedding = [-10.0] * 128
    # res = retriever.run(query_embedding)


if __name__ == '__main__':
    run(document_store)

## Time to write documents: 0.7143099308013916 seconds

If everything is right, the Time to write documents should be a small number.

from milvus.

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.