Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix bug chunking:expected string or bytes-like object (#7116)

QuintinTao1b4016317e64
diff --git a/rag/app/table.py b/rag/app/table.py
index 6ecab04274..14facd1690 100644
--- a/rag/app/table.py
+++ b/rag/app/table.py
@@ -193,6 +193,9 @@ def chunk(filename, binary=None, from_page=0, to_page=10000000000,
if n in df.columns:
del df[n]
clmns = df.columns.values
+ if len(clmns) != len(set(clmns)):
+ duplicates = [col for col in clmns if list(clmns).count(col) > 1]
+ raise ValueError(f"Duplicate column names detected: {set(duplicates)}")
txts = list(copy.deepcopy(clmns))
py_clmns = [
PY.get_pinyins(