浏览代码

Update mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Xiaomeng Zhao 4 周之前
父节点
当前提交
c8ccf4cf20
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py

+ 1 - 1
mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py

@@ -219,7 +219,7 @@ class AttentionMaskConverter:
 
         if causal_4d_mask is not None:
             expanded_attn_mask = causal_4d_mask.masked_fill_(
-                expanded_attn_mask.cast(torch.bool), torch.finfo(dtype).min
+                expanded_attn_mask.to(torch.bool), torch.finfo(dtype).min
             )
 
         expanded_4d_mask = expanded_attn_mask