Comments (12)
I think it's fine to do this in a colab notebook
from langroid.
How about instead -- when storage_path
is specified anywhere in the code, we recreate the client (whether chroma
or qdrant
) ?
from langroid.
Actually this will lead to the "storage path already used" error I think
from langroid.
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.
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.
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.
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.
yes, I was thinking about this, let me try it
from langroid.
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.
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.
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.
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)
- ModuleNotFoundError: No module named 'langroid.agent'; 'langroid' is not a package HOT 10
- load faster... HOT 21
- Add `tests/extras` to gh actions workflows HOT 1
- Cannot run example with local LLM, e.g. Mistral HOT 5
- Pydantic import Basemodel throws import error in examples HOT 2
- Retrieval updates
- Trouble getting DependencyChatbot example working HOT 2
- Find good workaround for limitations in `pandas.eval()` HOT 1
- `ImagePdfParser` module causes Langroid import error HOT 3
- structure-aware chunking of code and markdown HOT 3
- openai.AuthenticationError - OpenAI API key needed to access DocChatAgent using Ollama? HOT 2
- DocChatAgent ingest_docs: add window_ids after chunk creation HOT 2
- How do I use langroid to call a public API? HOT 3
- Can I use the Business LLM Model API in langroid? HOT 1
- Skipping USER when using a tool HOT 6
- 'langroid' is not a package HOT 6
- Error : each t must be a type. Got <module 'PIL.Image' HOT 2
- Need to fix -- Langroid import error in Colab notebook, with Python 3.10 HOT 2
- Update to latest DuckDuckGo search HOT 1
- Add pgvector vectorstore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langroid.