8000 Add Azure OpenAI service support to marker package by MauritsBrinkman · Pull Request #675 · datalab-to/marker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Azure OpenAI service support to marker package #675

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

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

MauritsBrinkman
Copy link
  • Create AzureOpenAIService class that implements BaseService interface
  • Fix duplicate function name in test_service_init.py
  • Add test case for Azure OpenAI service
  • 8000
  • Update README.md to document Azure OpenAI service option
  • Add sample script for converting PDFs with Azure OpenAI

This implementation allows marker to use Azure OpenAI for LLM-enhanced processing and image descriptions by configuring azure_endpoint, azure_api_key and deployment_name parameters.

- Create AzureOpenAIService class that implements BaseService interface
- Fix duplicate function name in test_service_init.py
- Add test case for Azure OpenAI service
- Update README.md to document Azure OpenAI service option
- Add sample script for converting PDFs with Azure OpenAI

This implementation allows marker to use Azure OpenAI for LLM-enhanced
processing and image descriptions by configuring azure_endpoint,
azure_api_key and deployment_name parameters.
Copy link
Contributor
github-actions bot commented Apr 29, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@MauritsBrinkman
Copy link
Author

I have read the CLA document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Apr 29, 2025
@chintan1891
Copy link

@VikParuchuri Can you please review this & merge it?

…ions

The inference_blocks method in LLMImageDescriptionProcessor had a logic error
where it would return an empty list when extract_images=True, effectively
disabling all image description processing. This is counterintuitive and
contradicts the documented behavior where extract_images should control
whether to keep images in output, not whether to generate descriptions.

This fix ensures the processor always proce
8000
sses image blocks and generates
descriptions regardless of the extract_images setting, aligning with the
expected behavior described in the CLI documentation.
@Adlef
Copy link
Adlef commented May 8, 2025

Agreed. I would be interested to get it merged please. Thanks!

@Adlef
Copy link
Adlef commented May 19, 2025

@VikParuchuri : could you have a look into this PR please? Thanks a lot :)

@VikParuchuri VikParuchuri changed the base branch from master to dev May 19, 2025 17:04
Copy link
Member
@VikParuchuri VikParuchuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! A couple of questions in the comments

@@ -41,8 +41,6 @@ class LLMImageDescriptionProcessor(BaseLLMSimpleBlockProcessor):

def inference_blocks(self, document: Document) -> List[BlockData]:
blocks = super().inference_blocks(document)
if self.extract_images:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think self.extract_images default True, so inference_blocks() return []. We should remove them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - I found this one during debugging: with extract_images=True (default), the processor would never process any images, making it completely non-functional... So removing ensures the processor actually does its job of generating image descriptions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can set extract_images=False in confict, so don't need remove them

grahama1970 pushed a commit to grahama1970/marker that referenced this pull request Jun 2, 2025
@MauritsBrinkman
Copy link
Author
MauritsBrinkman commented Jun 4, 2025

@tuantran23012000 @VikParuchuri I think we're now ready to merge this? Removed the langchain dependency

@VikParuchuri VikParuchuri force-pushed the dev branch 2 times, most recently from fe180a0 to 06ad1e6 Compare June 6, 2025 18:59
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.

6 participants
0