Skip to content

Commit d94af76

Browse files
author
yuehuazhang
committed
Merge branch 'master' of github.com:chatchat-space/LangGraph-Chatchat into feature/api
2 parents ba0fc55 + 1d4ed8d commit d94af76

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

chatchat-server/chatchat/server/file_rag/text_splitter/ali_text_splitter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def split_text(self, text: str) -> List[str]:
1515
# 考虑到使用了三个模型,可能对于低配置gpu不太友好,因此这里将模型load进cpu计算,有需要的话可以替换device为自己的显卡id
1616
if self.pdf:
1717
text = re.sub(r"\n{3,}", r"\n", text)
18-
text = re.sub("\s", " ", text)
19-
text = re.sub("\n\n", "", text)
18+
text = re.sub(r"\s", " ", text)
19+
text = re.sub(r"\n\n", "", text)
2020
try:
2121
from modelscope.pipelines import pipeline
2222
except ImportError:

chatchat-server/chatchat/server/file_rag/text_splitter/chinese_recursive_text_splitter.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def __init__(
4141
self._separators = separators or [
4242
"\n\n",
4343
"\n",
44-
"。|!|?",
45-
"\.\s|\!\s|\?\s",
46-
";|;\s",
47-
",|,\s",
44+
r"。|!|?",
45+
r"\.\s|\!\s|\?\s",
46+
r";|;\s",
47+
r",|,\s",
4848
]
4949
self._is_separator_regex = is_separator_regex
5050

0 commit comments

Comments
 (0)