Skip to content

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

Open
@anth0nyhak1m

Description

@anth0nyhak1m

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions