formatting fixes

This commit is contained in:
William Easton 2025-06-30 08:32:40 -05:00
parent 7ad02f234d
commit 963e343250
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import logging
from abc import abstractmethod
from collections.abc import Iterable
from pathlib import Path
from typing import List, Optional, Type
from typing import TYPE_CHECKING, List, Optional, Type
import numpy as np
from docling_core.types.doc import BoundingBox, CoordOrigin
@ -20,6 +20,9 @@ from docling.models.base_model import BaseModelWithOptions, BasePageModel
_log = logging.getLogger(__name__)
if TYPE_CHECKING:
from scipy.ndimage import binary_dilation, find_objects, label
class BaseOcrModel(BasePageModel, BaseModelWithOptions):
def __init__(

View File

@ -1,5 +1,3 @@
def ocr_engines():
from docling.models.easyocr_model import EasyOcrModel
from docling.models.ocr_mac_model import OcrMacModel

View File

@ -17,6 +17,7 @@ def decide_device(
2. User-defined: Check if the device actually exists, otherwise fall-back to CPU
"""
import torch
device = "cpu"
has_cuda = torch.backends.cuda.is_built() and torch.cuda.is_available()