mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 12:39:32 +00:00
fix bug with length function (#1257)
This commit is contained in:
@@ -250,7 +250,7 @@ class RecursiveCharacterTextSplitter(TextSplitter):
|
|||||||
# Now go merging things, recursively splitting longer texts.
|
# Now go merging things, recursively splitting longer texts.
|
||||||
_good_splits = []
|
_good_splits = []
|
||||||
for s in splits:
|
for s in splits:
|
||||||
if len(s) < self._chunk_size:
|
if self._length_function(s) < self._chunk_size:
|
||||||
_good_splits.append(s)
|
_good_splits.append(s)
|
||||||
else:
|
else:
|
||||||
if _good_splits:
|
if _good_splits:
|
||||||
|
Reference in New Issue
Block a user