Jyong 1 месяц назад
Родитель
Сommit
f77f7e1437
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      api/core/rag/splitter/fixed_text_splitter.py

+ 4 - 1
api/core/rag/splitter/fixed_text_splitter.py

@@ -88,7 +88,10 @@ class FixedRecursiveCharacterTextSplitter(EnhanceRecursiveCharacterTextSplitter)
                 break
                 break
         # Now that we have the separator, split the text
         # Now that we have the separator, split the text
         if separator:
         if separator:
-            splits = text.split(separator)
+            if separator == " ":
+                splits = text.split()
+            else:
+                splits = text.split(separator)
         else:
         else:
             splits = list(text)
             splits = list(text)
         # Now go merging things, recursively splitting longer texts.
         # Now go merging things, recursively splitting longer texts.