mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-09-24 23:10:23 +08:00
refactor(magic_pdf): comment out npu-related code
- Remove use_npu variable initialization - Comment out device assignment and npu check - Comment out use_npu parameter in ModifiedPaddleOCR constructor
This commit is contained in:
@@ -70,10 +70,10 @@ def ocr_model_init(show_log: bool = False,
|
||||
det_db_unclip_ratio=1.8,
|
||||
):
|
||||
|
||||
use_npu = False
|
||||
device = get_device()
|
||||
if str(device).startswith("npu"):
|
||||
use_npu = True
|
||||
# use_npu = False
|
||||
# device = get_device()
|
||||
# if str(device).startswith("npu"):
|
||||
# use_npu = True
|
||||
|
||||
if lang is not None and lang != '':
|
||||
model = ModifiedPaddleOCR(
|
||||
@@ -82,7 +82,7 @@ def ocr_model_init(show_log: bool = False,
|
||||
lang=lang,
|
||||
use_dilation=use_dilation,
|
||||
det_db_unclip_ratio=det_db_unclip_ratio,
|
||||
use_npu=use_npu,
|
||||
# use_npu=use_npu,
|
||||
)
|
||||
else:
|
||||
model = ModifiedPaddleOCR(
|
||||
@@ -90,7 +90,7 @@ def ocr_model_init(show_log: bool = False,
|
||||
det_db_box_thresh=det_db_box_thresh,
|
||||
use_dilation=use_dilation,
|
||||
det_db_unclip_ratio=det_db_unclip_ratio,
|
||||
use_npu=use_npu,
|
||||
# use_npu=use_npu,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user