How to disable the warnings logs (created a chunk of size... ) that we get during text splitting? #19256
Replies: 5 comments 4 replies
-
Hey there, @prakhar7651! Great to see you diving into the depths of LangChain again. 🚀 Based on the information provided, the You can use the from langchain_core.globals import set_verbose, set_debug
# Disable verbose logging
set_verbose(False)
# Disable debug logging
set_debug(False) This will affect how verbose or detailed the logging output will be across all modules that respect these settings. Please note that this might not suppress the specific warning you mentioned, as it depends on how the If you want to suppress all warnings, you can adjust the logging level to import logging
logging.getLogger().setLevel(logging.ERROR) This will suppress all logs with a level lower than You can find more information about logging in Python in the official Python documentation. I hope this helps! If you have any other questions or need further clarification, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
@dosu-bot I tried both |
Beta Was this translation helpful? Give feedback.
-
any updates on this? |
Beta Was this translation helpful? Give feedback.
-
I think this should work. It ignores LogRecords that pertain to |
Beta Was this translation helpful? Give feedback.
-
I was using CharacterTextSplitter from langchain_text_splitters and the warning messages were in the form "WARNING:langchain_text_splitters.base:Created a chunk of size...". I was able to get rid of them by:
|
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
If we run the above code, we get some warning logs saying that
Created a chunk of size 39, which is longer than the specified 1
. Can we disable this logging? We can use the logging module to disable warning logs but should we allow a parameter (likeverbose
) which can control this behavior?System Info
langchain==0.0.297
langchain-core==0.1.1
linux
Python 3.10.12
Beta Was this translation helpful? Give feedback.
All reactions