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

bug/NameError: name 'LayoutElements' is not defined #3931

Open
anth0nyhak1m opened this issue Feb 19, 2025 · 0 comments
Open

bug/NameError: name 'LayoutElements' is not defined #3931

anth0nyhak1m opened this issue Feb 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@anth0nyhak1m
Copy link

anth0nyhak1m commented Feb 19, 2025

Hello unstructured team,

I ran into a bug where the module: unstructured/partition/utils/ocr_models/paddle_ocr.py

Would return the bug described above.

Here was my fix:

in the document where I call partition_pdf()

I set the namespace like so:

import unstructured.partition.utils.ocr_models.paddle_ocr as paddle_ocr_modue
from unstructure_inference.inference.layoutelement import LayoutElements

paddle_ocr_module.LayoutElements = LayoutElements

I am not sure if this is a sustainable solution, and I am not sure why the module itself is not able to find the definition of LayoutElements itself without me manually setting the namespace.

I made sure to have TYPING dependency, and at some point I even removed the condition, neither of which worked.

Please let me know if I missed something during installation that is causing this.

Thanks!

@anth0nyhak1m anth0nyhak1m added the bug Something isn't working label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant