Skip to content

Replacing LayoutPredictor model with SmolDocling #89

@agodinezmm2007

Description

@agodinezmm2007

Hello,

I have made extensive modifications to these two files:
docling_ibm_models/code_formula_model/code_formula_predictor.py
docling/models/code_formula_model.py

in order to replace the codeformula model with smoldocling and it works well enough for a couple PDF's but if the formula snippet images contain extra text from the cropping not being perfect it will generate nonsense and repeat until reaching max tokens. I figured that instead of feeding it the snippets like the original CodeFormula model, I could modify the LayoutPredictor files so that SmolDocling generates the doctags document for the entire PDF page which. However, i'm not sure if I can simply change the repo folders to use SmolDocling since it seems like the layout model uses a mapping schema not found within the SmolDocling configuration files, though. Any guidance on replacing/integrating SmolDocling into this part of the pipeline?

Also wanted to add: When using the original CodeFormula model within the docling pdf pipeline VRAM usage would swell to 20-30 GB, with smoldocling doing the code formula predictions I havent seen it go past 10,000 MB once

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions