Skip to content

Disable image processor loading for THUDM/glm-4v-9b#2315

Merged
regisss merged 1 commit intohuggingface:mainfrom
HabanaAI:dev/pbielak/fix-chatglm
Oct 21, 2025
Merged

Disable image processor loading for THUDM/glm-4v-9b#2315
regisss merged 1 commit intohuggingface:mainfrom
HabanaAI:dev/pbielak/fix-chatglm

Conversation

@pbielak
Copy link
Collaborator

@pbielak pbielak commented Oct 20, 2025

What does this PR do?

After the Transformers 4.51->4.55 upgrade, the pipeline(...) function was completely refactored [1]. The logic related to loading individual components of a given pipeline was also updated. Now, despite setting the image_processor=None argument, when dealing with the chatglm model, the code in the pipeline(...) will still try to load the image processor, which fails eventually (chatglm does not have an image processor class). To fix that, this commit overrides the ImageToTextPipeline._load_image_processor property to False.

[1] huggingface/transformers@3d8be20

After the Transformers 4.51->4.55 upgrade, the `pipeline(...)` function
was completely refactored [1]. The logic related to loading individual
components of a given pipeline was also updated. Now, despite setting
the `image_processor=None` argument, when dealing with the `chatglm`
model, the code in the `pipeline(...)` will still try to load the image
processor, which fails eventually (`chatglm` does not have an image
processor class). To fix that, this commit overrides the
`ImageToTextPipeline._load_image_processor` property to `False`.

[1] huggingface/transformers@3d8be20
@pbielak pbielak requested a review from regisss as a code owner October 20, 2025 12:47
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@karol-brejna-i
Copy link
Collaborator

@pbielak Yes, the change breaks functional tests (README examples).
Until solved "holistically", it still fills like a proper fix to enable the broken functionality...

Copy link
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

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

LGTM

@regisss regisss merged commit 37b8855 into huggingface:main Oct 21, 2025
2 of 4 checks passed
@pbielak
Copy link
Collaborator Author

pbielak commented Oct 21, 2025

@regisss please cherry-pick to v1.20-release

regisss pushed a commit that referenced this pull request Oct 21, 2025
Co-authored-by: Piotr Bielak <pbielak@habana.ai>
@regisss
Copy link
Collaborator

regisss commented Oct 21, 2025

@regisss please cherry-pick to v1.20-release

Done

gplutop7 pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Nov 6, 2025
…) (huggingface#785)

Co-authored-by: Piotr Bielak <pbielak@users.noreply.github.com>
Co-authored-by: Piotr Bielak <pbielak@habana.ai>
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.

4 participants