Skip to content

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

Update mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py

Xiaomeng Zhaoe7485c5d79ae
diff --git a/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py b/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py
index 3c1b1108..859fc3d8 100644
--- a/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py
+++ b/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py
@@ -64,6 +64,7 @@ class FormulaRecognizer(BaseOCRV20):
)
def predict(self, img_list, batch_size: int = 64):
+ # Reduce batch size by 50% to avoid potential memory issues during inference.
batch_size = int(0.5 * batch_size)
batch_imgs = self.pre_tfs["UniMERNetImgDecode"](imgs=img_list)
batch_imgs = self.pre_tfs["UniMERNetTestTransform"](imgs=batch_imgs)