Skip to content

[model deprecations] Define new version-based model deprecation/deletions with user warnings/exceptions#41315

Open
gante wants to merge 2 commits into
huggingface:mainfrom
gante:version_based_deprecations
Open

[model deprecations] Define new version-based model deprecation/deletions with user warnings/exceptions#41315
gante wants to merge 2 commits into
huggingface:mainfrom
gante:version_based_deprecations

Conversation

@gante

@gante gante commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

PR 1 out of 3 regarding model deprecation/deletions for v5

We now define a new {model type: last version where it was supported} mapping, which we use to:

  • automatically set deprecation warnings (when set version > current version)
  • automatically trigger informative exceptions in AutoClasses (when set version < current version, i.e. after the corresponding model is deleted)

This should improve our messaging to the users and allow us to stop investing energy in low-usage architectures.

🤗 inspired by our vllm friends 🤗


Follow-up PRs:

  • 2 out of 3: Move a few models into the deprecated folder, as discussed on slack (target deletion version: 5.2, two minor versions after the first release that will have the deprecation warning)
  • 3 out of 3: Delete models that were previously in the deprecated folder (most of them don't work in main in any case 👀 ). If it's not too complex, define import-time exceptions for the deleted classes (e.g. when a user tries to call from transformers import XXXModel, XXXModel being a deleted class).

@github-actions

github-actions Bot commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto

@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.

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.

2 participants