mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-23 11:36:38 +08:00
Fix: empty chunk issue. (#12638)
#12570 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -93,6 +93,8 @@ class Splitter(ProcessBase):
|
||||
split_sec = re.split(r"(%s)" % custom_pattern, c, flags=re.DOTALL)
|
||||
if split_sec:
|
||||
for j in range(0, len(split_sec), 2):
|
||||
if not split_sec[j].strip():
|
||||
continue
|
||||
docs.append({
|
||||
"text": split_sec[j],
|
||||
"mom": c
|
||||
@ -156,6 +158,8 @@ class Splitter(ProcessBase):
|
||||
if split_sec:
|
||||
c["mom"] = c["text"]
|
||||
for j in range(0, len(split_sec), 2):
|
||||
if not split_sec[j].strip():
|
||||
continue
|
||||
cc = deepcopy(c)
|
||||
cc["text"] = split_sec[j]
|
||||
docs.append(cc)
|
||||
|
||||
Reference in New Issue
Block a user