fix: skip picture description model init when disabled#3052
fix: skip picture description model init when disabled#3052Br1an67 wants to merge 1 commit intodocling-project:mainfrom
Conversation
When do_picture_description is False, ConvertPipeline.__init__ no longer calls the picture description model factory. This prevents RuntimeError when optional VLM dependencies are not installed, which is common for SimplePipeline use cases (DOCX, HTML, PPTX conversions). Previously, the factory was always called regardless of the flag, and would fail with 'No class found' if the VLM plugin was not registered. Signed-off-by: Br1an67 <932039080@qq.com>
|
✅ DCO Check Passed Thanks @Br1an67, all your commits are properly signed off. 🎉 |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
|
@Br1an67 which dependency is missing? I think we should have lazy loading for all the model inference engines. |
|
Good point — I traced through the current code and you're right: the plugin registration in The original issue was reported on v2.58.0, before the pluggable VLM runtime system existed. The error ( That said, this change still provides a small benefit: when |
|
Apologies, I missed the second part of your comment about lazy loading. Regarding the missing dependency — the original reporter was on v2.58.0, where the factory produced On lazy loading for all model inference engines — I agree that's the right approach. Would you prefer I:
Happy to go either direction. |
|
For the moment we should not change the approach of adding stages to the pipeline, given that they should have the proper lazy-loading in place. We also have an important WIP in #2952 which will rely on it. I don't think #2515 is a valid issue anymore and should more likely be closed. So I proposed you close this PR, and if you want to check that the |
|
Thanks for the clear guidance. Closing this PR — agreed that #2515 is no longer valid with the current plugin system. I'll look into auditing the |
Issue resolved by this Pull Request:
Resolves #2515
When
do_picture_descriptionisFalse,ConvertPipeline.__init__no longer calls the picture description model factory. This preventsRuntimeErrorwhen optional VLM dependencies are not installed, which is common forSimplePipelineuse cases (DOCX, HTML, PPTX conversions).Previously, the factory was always invoked regardless of the flag, and would fail with
No class found with the name 'vlm'if the VLM plugin was not registered.Checklist: