Commit 88b909e2 authored by myhloli's avatar myhloli
Browse files

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
parent 2684e775
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment