From f77f7e143756adbb5f3919377817e44cafc73e37 Mon Sep 17 00:00:00 2001 From: Jyong <76649700+JohnJyong@users.noreply.github.com> Date: Tue, 11 Mar 2025 00:24:27 +0800 Subject: [PATCH] fix text split (#15426) --- api/core/rag/splitter/fixed_text_splitter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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.