Browse Source

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 months ago
parent
commit
45f5082613

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