Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open a Deeplake dataset in read only mode #2240

Conversation

jc-tzn
Copy link
Contributor

@jc-tzn jc-tzn commented Mar 31, 2023

I'm using Deeplake as a vector store for a Q&A application. When several questions are being processed at the same time for the same dataset, the 2nd one triggers the following error:

LockedException: This dataset cannot be open for writing as it is locked by another machine. Try loading the dataset with read_only=True.

Answering questions doesn't require writing new embeddings so it's ok to open the dataset in read only mode at that time.

This pull request thus adds the read_only option to the Deeplake constructor and to its subsequent deeplake.load() call.

The related Deeplake documentation is here.

I've tested this update on my local dev environment. I don't know if an integration test and/or additional documentation are expected however. Let me know if it is, ideally with some guidance as I'm not particularly experienced in Python.

@jc-tzn jc-tzn changed the title Allow opening a Deeplake dataset in read only mode Open a Deeplake dataset in read only mode Apr 1, 2023
Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thanks!

@hwchase17 hwchase17 merged commit 5a0844b into langchain-ai:master Apr 1, 2023
9 checks passed
@jc-tzn jc-tzn deleted the codespace-jc-tzn-bookish-enigma-9jrpg6qjr627756 branch April 1, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants