Skip to content

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

Fix csv reader exception. (#4628)

Kevin Hu9d717f0b6e5a
diff --git a/rag/app/qa.py b/rag/app/qa.py
index 0ad2dc9fe7..ebc3677a21 100644
--- a/rag/app/qa.py
+++ b/rag/app/qa.py
@@ -394,7 +394,7 @@ def chunk(filename, binary=None, lang="Chinese", callback=None, **kwargs):
f"{len(fails)} failure, line: %s..." % (",".join(fails[:3])) if fails else "")))
if question:
- res.append(beAdoc(deepcopy(doc), question, answer, eng, len(reader)))
+ res.append(beAdoc(deepcopy(doc), question, answer, eng, len(list(reader))))
callback(0.6, ("Extract Q&A: {}".format(len(res)) + (
f"{len(fails)} failure, line: %s..." % (",".join(fails[:3])) if fails else "")))