diff --git a/api/core/rag/splitter/fixed_text_splitter.py b/api/core/rag/splitter/fixed_text_splitter.py index 2d99cce513..5d34c80113 100644 --- a/api/core/rag/splitter/fixed_text_splitter.py +++ b/api/core/rag/splitter/fixed_text_splitter.py @@ -88,7 +88,10 @@ class FixedRecursiveCharacterTextSplitter(EnhanceRecursiveCharacterTextSplitter) break # Now that we have the separator, split the text if separator: - splits = text.split(separator) + if separator == " ": + splits = text.split() + else: + splits = text.split(separator) else: splits = list(text) # Now go merging things, recursively splitting longer texts.