Browse Source

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Xiaomeng Zhao 3 tuần trước cách đây
mục cha
commit
e7485c5d79
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py

+ 1 - 0
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)