Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
Update mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py
Xiaomeng Zhao33d43a5afc30
diff --git a/mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py b/mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.pyindex cfa8e939..45d73c2d 100644--- a/mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py+++ b/mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py@@ -251,13 +251,13 @@ class AttentionMaskConverter:bsz, src_len = mask.shapetgt_len = tgt_len if tgt_len is not None else src_lenexpanded_mask = (- mask[:, None, None, :].expand([bsz, 1, tgt_len, src_len]).cast(dtype)+ mask[:, None, None, :].expand([bsz, 1, tgt_len, src_len]).to(dtype))inverted_mask = 1.0 - expanded_maskreturn inverted_mask.masked_fill_(- inverted_mask.cast(torch.bool), torch.finfo(dtype).min+ inverted_mask.to(torch.bool), torch.finfo(dtype).min)def _expand_mask_export(self, mask, dtype, tgt_len=None):