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 <ihar.hrachyshka@gmail.com>
This commit is contained in:
Ihar Hrachyshka 2025-04-09 12:02:56 -04:00
parent 71148eb381
commit e31bb03bff

View File

@ -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