Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

fix(tools): handle empty language string in common.py

myhloli20ed0cd5fbab
diff --git a/magic_pdf/tools/common.py b/magic_pdf/tools/common.py
index e7137dc4..7f4fb7ed 100644
--- a/magic_pdf/tools/common.py
+++ b/magic_pdf/tools/common.py
@@ -94,6 +94,9 @@ def do_parse(
f_draw_model_bbox = True
f_draw_line_sort_bbox = True
+ if lang == "":
+ lang = None
+
pdf_bytes = convert_pdf_bytes_to_bytes_by_pymupdf(pdf_bytes, start_page_id, end_page_id)
orig_model_list = copy.deepcopy(model_list)