Git Product home page Git Product logo

Comments (12)

pchalasani avatar pchalasani commented on May 20, 2024 1

I think it's fine to do this in a colab notebook

from langroid.

pchalasani avatar pchalasani commented on May 20, 2024

How about instead -- when storage_path is specified anywhere in the code, we recreate the client (whether chroma or qdrant) ?

from langroid.

pchalasani avatar pchalasani commented on May 20, 2024

Actually this will lead to the "storage path already used" error I think

from langroid.

pchalasani avatar pchalasani commented on May 20, 2024

I think we should have a set_storage_path method on the VectorStore class, and it will do the right checks and prevent re-creation of client if it exists and the storage_path has not changed.

from langroid.

pchalasani avatar pchalasani commented on May 20, 2024

As for preventing setting member variable storage_class on a vecdb object, that is a separate problem. In theory one can try to set any member value of a class, and there are ways to prevent setting members other than those in an allowed list. I don't know if we should do that, as that is an issue for any class.

from langroid.

Mohannadcse avatar Mohannadcse commented on May 20, 2024

Yes, this approach set_storage_path will help to avoid the situation above.
But how this will fix the colab situation? this error RuntimeError: Storage folder .qdrant/data/ is already accessed by another instance of Qdrant client. If you require concurrent access, use Qdrant server instead.

from langroid.

pchalasani avatar pchalasani commented on May 20, 2024

In a notebook with multiple examples, each example will try to create a client anew. We should explicitly set a new storage path for each example, that should solve it?

from langroid.

Mohannadcse avatar Mohannadcse commented on May 20, 2024

yes, I was thinking about this, let me try it

from langroid.

Mohannadcse avatar Mohannadcse commented on May 20, 2024

In a notebook with multiple examples, each example will try to create a client anew. We should explicitly set a new storage path for each example, that should solve it?

Just tried this approach, works

from langroid.

Mohannadcse avatar Mohannadcse commented on May 20, 2024

Actually, doesn't solve the problem. If the user wants to run the same example again, the same error will show up, even if I every time create a new QdrantDBConfig (include changing storage_path), because the port is still allocated. We need to free the port every time we run the example.

from langroid.

pchalasani avatar pchalasani commented on May 20, 2024

That is expected behavior, since the notebook retains state across runs, unless we restart the kernel.

The only way to solve these "vecdb client creation" issues is to check if there is a client already, and I don't know if there is a way to do that .

from langroid.

Mohannadcse avatar Mohannadcse commented on May 20, 2024

I added this logic before creating any config to solve the problem

folder_path = '.data1/data1/'

if os.path.exists(folder_path) and os.path.isdir(folder_path):
    shutil.rmtree(folder_path)
    print(f"The folder '{folder_path}' and all its contents have been removed.")
else:
    print(f"The folder '{folder_path}' does not exist.")

from langroid.

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.