-
Notifications
You must be signed in to change notification settings - Fork 6k
Introduce DeprecatedPipelineMixin to simplify pipeline deprecation process #11596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extremely good!
If we feel the need to deprecate some pipelines in the next quarter we can also involve the community for that.
# Skip tests for pipelines that inherit from DeprecatedPipelineMixin | ||
from diffusers.pipelines.pipeline_utils import DeprecatedPipelineMixin | ||
|
||
if hasattr(self, "pipeline_class") and issubclass(self.pipeline_class, DeprecatedPipelineMixin): | ||
import pytest | ||
|
||
pytest.skip(reason=f"Deprecated Pipeline: {self.pipeline_class.__name__}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
What does this PR do?
Realised that our current deprecation process as seen in this PR: #11354 is quite a big maintenance burden since it isn't trivial to prevent imports from breaking. We have to update a lot of loading code to account for the deprecated pipeline module which is less than ideal.
This PR
_last_supported_version
class attribute so that it's clear that pipelines may not work as expected past this version.Now no other changes to the codebase should be required when deprecating pipelines. Will close #11354 in favour of this PR.
Fixes # (issue)
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
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.