mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 12:34:22 +00:00
fix: Correct the way to set GPU for EasyOCR, RapidOCR
Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com> Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
parent
99ccb69a47
commit
6bc1bd2ec4
@ -48,7 +48,7 @@ class EasyOcrModel(BaseOcrModel):
|
|||||||
use_gpu = any(
|
use_gpu = any(
|
||||||
filter(
|
filter(
|
||||||
lambda x: str(x) in device,
|
lambda x: str(x) in device,
|
||||||
[AcceleratorDevice.CUDA, AcceleratorDevice.MPS],
|
["cuda", "mps"],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class RapidOcrModel(BaseOcrModel):
|
|||||||
|
|
||||||
# Decide the accelerator devices
|
# Decide the accelerator devices
|
||||||
device = decide_device(accelerator_options.device)
|
device = decide_device(accelerator_options.device)
|
||||||
use_cuda = AcceleratorDevice.CUDA in device
|
use_cuda = "cuda" in device
|
||||||
use_dml = accelerator_options.device == AcceleratorDevice.AUTO
|
use_dml = accelerator_options.device == AcceleratorDevice.AUTO
|
||||||
intra_op_num_threads = accelerator_options.num_threads
|
intra_op_num_threads = accelerator_options.num_threads
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user