make vlm_pipeline python3.9 compatible

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
Maksym Lysak 2025-03-19 13:56:57 +01:00
parent 9182d8a622
commit a9cf823187

View File

@ -91,7 +91,9 @@ class VlmPipeline(PaginatedPipeline):
return page
def extract_text_from_backend(self, page: Page, bbox: BoundingBox | None) -> str:
def extract_text_from_backend(
self, page: Page, bbox: Union[BoundingBox | None]
) -> str:
# Convert bounding box normalized to 0-100 into page coordinates for cropping
text = ""
if bbox: