浏览代码

refactor(ocr): update device parameter handling in paddleocr2pytorch

- Replace get_device() function call with direct 'device' variable usage
- Simplify device configuration in OCR model initialization
myhloli 6 月之前
父节点
当前提交
45f5082613
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      magic_pdf/model/sub_modules/ocr/paddleocr2pytorch/pytorch_paddle.py

+ 1 - 1
magic_pdf/model/sub_modules/ocr/paddleocr2pytorch/pytorch_paddle.py

@@ -80,7 +80,7 @@ class PytorchPaddleOCR(TextSystem):
         kwargs['rec_char_dict_path'] = os.path.join(root_dir, 'pytorchocr', 'utils', 'resources', 'dict', dict_file)
         # kwargs['rec_batch_num'] = 8
 
-        kwargs['device'] = get_device()
+        kwargs['device'] = device
 
         default_args = vars(args)
         default_args.update(kwargs)