Skip to content

fix for GenerationConfig issue for pipeline init changes by transformers update#2266

Merged
regisss merged 1 commit intohuggingface:mainfrom
mengker33:fix_generation_config
Sep 19, 2025
Merged

fix for GenerationConfig issue for pipeline init changes by transformers update#2266
regisss merged 1 commit intohuggingface:mainfrom
mengker33:fix_generation_config

Conversation

@mengker33
Copy link
Contributor

What does this PR do?

With transformers updated to 4.55.4, there are changes in pipeline init method and causes error in optimum-habana when using pipeline for multi-modal inference, error log shown below:

Traceback (most recent call last):
File "/workspace/optimum-habana/examples/image-to-text/run_pipeline.py", line 533, in
main()
File "/workspace/optimum-habana/examples/image-to-text/run_pipeline.py", line 375, in main
generator = pipeline(
File "/usr/local/lib/python3.10/dist-packages/transformers/pipelines/init.py", line 1210, in pipeline
return pipeline_class(model=model, framework=framework, task=task, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/pipelines/image_to_text.py", line 85, in init
super().init(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py", line 1064, in init
prepared_generation_config, kwargs = self.model._prepare_generation_config(
File "/workspace/optimum-habana/optimum/habana/transformers/generation/utils.py", line 1035, in _prepare_generation_config
if generation_config.static_shapes is None:
AttributeError: 'GenerationConfig' object has no attribute 'static_shapes'
FAILED

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@mengker33 mengker33 requested a review from regisss as a code owner September 18, 2025 05:37
@mengker33 mengker33 mentioned this pull request Sep 18, 2025
3 tasks
@pbielak
Copy link
Collaborator

pbielak commented Sep 18, 2025

@mengker33 Please check if your fix is still valid/required after merging #2264

CC: @regisss @AKloniecki @ugolowic

@mengker33
Copy link
Contributor Author

@mengker33 Please check if your fix is still valid/required after merging #2264

CC: @regisss @AKloniecki @ugolowic

It didn't resolve the issue with pipeline config. To ensure GaudiGenerationConfig correctly loaded by pipeline, we need this fix #2266

@mengker33 mengker33 force-pushed the fix_generation_config branch from 826affd to d73ea26 Compare September 18, 2025 08:43
@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.

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 27d1069 into huggingface:main Sep 19, 2025
2 of 5 checks passed
astachowiczhabana pushed a commit that referenced this pull request Sep 22, 2025
…ers update (#2266)

Co-authored-by: Zhou, Huijuan <huijuan.zhou@intel.com>
@astachowiczhabana
Copy link
Collaborator

LGTM

astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Sep 30, 2025
…ers update (huggingface#2266)

Co-authored-by: Zhou, Huijuan <huijuan.zhou@intel.com>
gplutop7 pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Oct 15, 2025
…ers update (huggingface#2266) (huggingface#701)

Co-authored-by: bmengke <mengkejiergeli.ba@intel.com>
Co-authored-by: Zhou, Huijuan <huijuan.zhou@intel.com>
gplutop7 pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Nov 6, 2025
…ers update (huggingface#2266) (huggingface#701)

Co-authored-by: bmengke <mengkejiergeli.ba@intel.com>
Co-authored-by: Zhou, Huijuan <huijuan.zhou@intel.com>
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.

7 participants