Skip to content

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

Fix: support vlm fall back in pipeline (#14007)

Magicbook110852f5880d213e
diff --git a/rag/flow/parser/parser.py b/rag/flow/parser/parser.py
index 5179356f70..182f07595f 100644
--- a/rag/flow/parser/parser.py
+++ b/rag/flow/parser/parser.py
@@ -625,15 +625,12 @@ class Parser(ProcessBase):
if abstract_idx is not None:
bboxes[abstract_idx]["abstract"] = True
- print(conf.get("vlm"))
-
- if conf.get("vlm"):
- enhance_media_sections_with_vision(
- bboxes,
- self._canvas._tenant_id,
- conf["vlm"],
- callback=self.callback,
- )
+ enhance_media_sections_with_vision(
+ bboxes,
+ self._canvas._tenant_id,
+ conf.get("vlm"),
+ callback=self.callback,
+ )
# Emit the requested final PDF output format.
if conf.get("output_format") == "json":
@@ -804,13 +801,12 @@ class Parser(ProcessBase):
"doc_type_kwd": "table",
}
)
- if conf.get("vlm"):
- enhance_media_sections_with_vision(
- sections,
- self._canvas._tenant_id,
- conf["vlm"],
- callback=self.callback,
- )
+ enhance_media_sections_with_vision(
+ sections,
+ self._canvas._tenant_id,
+ conf.get("vlm"),
+ callback=self.callback,
+ )
self.set_output("json", sections)
@@ -930,13 +926,12 @@ class Parser(ProcessBase):
json_result["doc_type_kwd"] = "image" if json_result.get("image") is not None else "text"
json_results.append(json_result)
- if conf.get("vlm"):
- enhance_media_sections_with_vision(
- json_results,
- self._canvas._tenant_id,
- conf["vlm"],
- callback=self.callback,
- )
+ enhance_media_sections_with_vision(
+ json_results,
+ self._canvas._tenant_id,
+ conf.get("vlm"),
+ callback=self.callback,
+ )
self.set_output("json", json_results)
else:
self.set_output("text", "\n".join([section_text for section_text, _ in sections]))
diff --git a/rag/flow/parser/utils.py b/rag/flow/parser/utils.py
index b897ab1704..96bfaff29a 100644
--- a/rag/flow/parser/utils.py
+++ b/rag/flow/parser/utils.py
@@ -125,7 +125,7 @@ def enhance_media_sections_with_vision(
vlm_conf=None,
callback=None,
):
- if not sections or not tenant_id or not vlm_conf:
+ if not sections or not tenant_id:
return sections
try: