Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing issue in inference_utils.py #3716

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cckolon
Copy link

@cckolon cckolon commented Oct 12, 2024

Looks like TextRegions and list[TextRegion] weren't consistent here. This was causing the following error in build_layout_elements_from_ocr_regions

AttributeError: 'list' object has no attribute 'element_coords'

While I was trying to partition this PDF with the hi_res strategy.

Update so that grouped_regions is always a list[TextRegions] and convert each TextRegions to a list[TextRegion] before running merge_text_regions on each element.

@cckolon cckolon marked this pull request as ready for review October 12, 2024 02:22
@christinestraub
Copy link
Collaborator

What versions of unstructured and unstructured-inference libraries are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants