Skip to content

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

fix: remove trailing backslashes from strings in modeling_unimernet.py

myhlolia392f445e8f9
diff --git a/mineru/model/mfr/unimernet/unimernet_hf/modeling_unimernet.py b/mineru/model/mfr/unimernet/unimernet_hf/modeling_unimernet.py
index a4a9bbb9..2c451c7a 100644
--- a/mineru/model/mfr/unimernet/unimernet_hf/modeling_unimernet.py
+++ b/mineru/model/mfr/unimernet/unimernet_hf/modeling_unimernet.py
@@ -374,6 +374,10 @@ def latex_rm_whitespace(s: str):
# \qquad后补空格
s = QQUAD_PATTERN.sub(r'\\qquad ', s)
+ # 如果字符串以反斜杠结尾,去掉最后的反斜杠
+ while s.endswith('\\'):
+ s = s[:-1]
+
return s