Skip to content

Commit

Permalink
fix: allow mps usage for easyocr
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
  • Loading branch information
dolfim-ibm committed Nov 9, 2024
1 parent be8aa17 commit 5f07114
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions docling/models/easyocr_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ def __init__(self, enabled: bool, options: EasyOcrOptions):
"Alternatively, Docling has support for other OCR engines. See the documentation."
)

use_gpu = (
False if torch.backends.mps.is_available() else self.options.use_gpu
)
self.reader = easyocr.Reader(
lang_list=self.options.lang,
gpu=use_gpu,
gpu=self.options.use_gpu,
model_storage_directory=self.options.model_storage_directory,
download_enabled=self.options.download_enabled,
)
Expand Down

0 comments on commit 5f07114

Please sign in to comment.