Skip to content

Commit

Permalink
fix bug with length function (#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchase17 authored Feb 24, 2023
1 parent 10e73a3 commit 9381005
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion langchain/text_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def split_text(self, text: str) -> List[str]:
# Now go merging things, recursively splitting longer texts.
_good_splits = []
for s in splits:
if len(s) < self._chunk_size:
if self._length_function(s) < self._chunk_size:
_good_splits.append(s)
else:
if _good_splits:
Expand Down

0 comments on commit 9381005

Please sign in to comment.