🐛 fix(loading.py): use 'is' instead of '==' to compare object types

The commit changes the comparison operator from '==' to 'is' to compare object types. This is because 'is' compares the object identity while '==' compares the object value. In this case, we want to compare the object identity, so 'is' is the correct operator to use.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-25 21:37:24 -03:00
commit 6459a27777

View file

@ -204,7 +204,7 @@ def instantiate_textsplitter(
"Try changing the chunk_size of the Text Splitter."
) from exc
if type(class_object) == RecursiveCharacterTextSplitter:
if class_object is RecursiveCharacterTextSplitter:
if "separator_type" in params and params["separator_type"] == "Text":
text_splitter = class_object(**params)
else: