Replies: 4 comments 2 replies
-
To suppress the warning message when deleting multiple documents from your Chroma vector store, you can modify the Here is an example of how you might modify the import warnings
from contextlib import contextmanager
@contextmanager
def suppress_langchain_deprecation_warning():
"""Context manager to suppress LangChainDeprecationWarning."""
with warnings.catch_warnings():
warnings.simplefilter("ignore", LangChainDeprecationWarning)
warnings.simplefilter("ignore", LangChainPendingDeprecationWarning)
yield
def delete(self, ids: Optional[List[str]] = None, **kwargs: Any) -> None:
"""Delete by vector IDs.
Args:
ids: List of ids to delete.
"""
with suppress_langchain_deprecation_warning():
self._collection.delete(ids=ids) This code will suppress all |
Beta Was this translation helpful? Give feedback.
-
hello, my goal is not to hide the warning but more understanding why it is happening and how to not make it happen without suppressing warning code |
Beta Was this translation helpful? Give feedback.
-
If you don't care about trying to delete non-existent ids, you can just silence warnings: import logging
logging.getLogger("chromadb").setLevel(logging.ERROR) |
Beta Was this translation helpful? Give feedback.
-
Same issue and the bot answer is useless. The real question is why is this happening - are documents not actually being deleted? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
Every time I am deleting documents from my DB with Chroma I had a warning message, and would like to understand if there is a way to remove it (basically not raising this warning). I suppose the way I am deleting is incomplete. It is raised when I am deleting multiples docs.
Here an example of Warning:
WARNING:chromadb.segment.impl.vector.brute_force_index:Delete of nonexisting embedding ID: 0320ada1-8930-4145-9418-fcf3f8f6a3bc
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
Beta Was this translation helpful? Give feedback.
All reactions