瀏覽代碼

fix: remove commented-out code for autocasting in prediction logic of predict_formula.py

myhloli 3 周之前
父節點
當前提交
fd79885b23
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py

+ 2 - 0
mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py

@@ -77,6 +77,8 @@ class FormulaRecognizer(BaseOCRV20):
             with tqdm(total=len(inp), desc="MFR Predict") as pbar:
                 for index in range(0, len(inp), batch_size):
                     batch_data = inp[index: index + batch_size]
+                    # with torch.amp.autocast(device_type=self.device.type):
+                    #     batch_preds = [self.net(batch_data)]
                     batch_preds = [self.net(batch_data)]
                     batch_preds = [p.reshape([-1]) for p in batch_preds[0]]
                     batch_preds = [bp.cpu().numpy() for bp in batch_preds]