Skip to content

Document how to handle non-persistent buffer initialization in custom models - #49880

Merged
stevhliu merged 4 commits into
huggingface:mainfrom
Tialo:docs/non-persistent-buffer-initialization
Oct 27, 2026
Merged

stevhliu merged 4 commits into
huggingface:mainfrom
Tialo:docs/non-persistent-buffer-initialization

Conversation

@Tialo

@Tialo Tialo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🤗 Transformers CI

What does this PR do?

As per title. This was changed in v5, breaks custom models using buffers for positional encoding. I think it's little unintuitive and deserves note in docs.

Before submitting

  • (First-time contributors only): I confirm that this PR description and code is not written by an LLM or code agent
  • 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 and the
    Pull Request checks?
  • 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 according to the guidelines?
  • 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.

@Rocketknight1

Copy link
Copy Markdown
Member

cc @stevhliu for docs

@stevhliu stevhliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks, just a suggestion to soften wording on models always being created on meta

Comment thread docs/source/en/add_new_model.md Resolved
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
@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.

@stevhliu
stevhliu added this pull request to the merge queue Oct 27, 2026
Merged via the queue into huggingface:main with commit 494470d Oct 27, 2026
34 checks passed
@Tialo
Tialo deleted the docs/non-persistent-buffer-initialization branch October 27, 2026 20:34
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