From 95497b4aab1dc6c25fb68d77fb6e29ce4d31d454 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 20 Mar 2025 14:50:59 +0800 Subject: [PATCH] Fix: adapt to old configurations. (#6321) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/app/naive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rag/app/naive.py b/rag/app/naive.py index 4549bf86b..5687b26ba 100644 --- a/rag/app/naive.py +++ b/rag/app/naive.py @@ -263,6 +263,8 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, elif re.search(r"\.pdf$", filename, re.IGNORECASE): layout_recognizer = parser_config.get("layout_recognize", "DeepDOC") + if isinstance(layout_recognizer, bool): + layout_recognizer = "DeepDOC" if layout_recognizer else "Plain Text" callback(0.1, "Start to parse.") if layout_recognizer == "DeepDOC":