瀏覽代碼

fix(mfr): add underscore symbol to unimernet

- Add \textunderscore to the list of LaTeX patterns
- This allows the model to properly render underscore characters
myhloli 7 月之前
父節點
當前提交
7d77d614ec
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      magic_pdf/model/sub_modules/mfr/unimernet/unimernet_hf/modeling_unimernet.py

+ 2 - 1
magic_pdf/model/sub_modules/mfr/unimernet/unimernet_hf/modeling_unimernet.py

@@ -342,7 +342,8 @@ REPLACEMENTS_PATTERNS = {
     re.compile(r'\\Tilde'): r'\\tilde',
     re.compile(r'\\slash'): r'/',
     re.compile(r'\\textperthousand'): r'‰',
-    re.compile(r'\\sun'): r'☉'
+    re.compile(r'\\sun'): r'☉',
+    re.compile(r'\\textunderscore'): r'\\_'
 }
 QQUAD_PATTERN = re.compile(r'\\qquad(?!\s)')