Skip to content

Fix TypeError: 'NoneType' object is not iterable in GenerationMixin.generate#45164

Merged
ArthurZucker merged 3 commits intohuggingface:mainfrom
albertvillanova:fix-44950-trl-5425
Apr 2, 2026
Merged

Fix TypeError: 'NoneType' object is not iterable in GenerationMixin.generate#45164
ArthurZucker merged 3 commits intohuggingface:mainfrom
albertvillanova:fix-44950-trl-5425

Conversation

@albertvillanova
Copy link
Copy Markdown
Member

What does this PR do?

Fix TypeError: 'NoneType' object is not iterable in GenerationMixin.generate

  • Fix for None layer_types

Fixes issue introduced in:

See the corresponding downstream issue in trl:

Code Agent Policy

The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.

PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.

This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read CONTRIBUTING.md.

  • I confirm that this is not a pure code agent PR.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@Cyrilvallez, who created the PR; @ArthurZucker, who reviewed it; @vasqu, who approved it

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=45164&sha=1e5271

@ArthurZucker ArthurZucker merged commit b10552e into huggingface:main Apr 2, 2026
27 of 29 checks passed
marvinzh pushed a commit to marvinzh/transformers that referenced this pull request Apr 3, 2026
SangbumChoi pushed a commit to SangbumChoi/transformers that referenced this pull request Apr 4, 2026
sirzechs66 pushed a commit to sirzechs66/transformers that referenced this pull request Apr 18, 2026
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