From e31bb03bffc07e0894b11ee5e6c29b029d2664bb Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 9 Apr 2025 12:02:56 -0400 Subject: [PATCH] fix: incorrect code suggestion for setting device type The warning suggests setting device to a enum value but decide_device function accepts strings only; which makes the passed device value (which is not a string) to never match anything in `==` comparisons with other strings. Signed-off-by: Ihar Hrachyshka --- docling/models/easyocr_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docling/models/easyocr_model.py b/docling/models/easyocr_model.py index 13eb33c9..f41e25b9 100644 --- a/docling/models/easyocr_model.py +++ b/docling/models/easyocr_model.py @@ -69,7 +69,7 @@ class EasyOcrModel(BaseOcrModel): else: warnings.warn( "Deprecated field. Better to set the `accelerator_options.device` in `pipeline_options`. " - "When `use_gpu and accelerator_options.device == AcceleratorDevice.CUDA` the GPU is used " + "When `use_gpu and accelerator_options.device == AcceleratorDevice.CUDA.value` the GPU is used " "to run EasyOCR. Otherwise, EasyOCR runs in CPU." ) use_gpu = self.options.use_gpu