Skip to content

fix: handle None llm_description in PptxConverter (fixes #1534) - #1587

Open
Muhtasim Munif Fahim (Muhtasim-Munif-Fahim) wants to merge 1 commit into
microsoft:mainfrom
Muhtasim-Munif-Fahim:fix/pptx-none-llm-caption
Open

fix: handle None llm_description in PptxConverter (fixes #1534)#1587
Muhtasim Munif Fahim (Muhtasim-Munif-Fahim) wants to merge 1 commit into
microsoft:mainfrom
Muhtasim-Munif-Fahim:fix/pptx-none-llm-caption

Conversation

@Muhtasim-Munif-Fahim

Copy link
Copy Markdown

Fixes #1534PptxConverter crashes with an UnboundLocalError/TypeError when the model returns None for image captions.

In _pptx_converter.py, changed the alt text assembly to coerce None variables to empty strings before joining them:
alt_text = "\n".join([llm_description or "", alt_text or ""]) or shape.name

Added a mocked test case in test_module_misc.py (test_pptx_null_llm_caption) that verifies markitdown survives a None return from llm_caption.

@Muhtasim-Munif-Fahim

Copy link
Copy Markdown
Author

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.

A bug when llm_description got None response from LLM in PptxConverter

2 participants