-
Couldn't load subscription status.
- Fork 6.5k
[tests] test encode_prompt() in isolation
#10438
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
Conversation
|
@hlky now that the PRs have been merged to support this, let's brainstorm if this is how we want to test |
|
@DN6 a gentle ping. |
|
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. |
encode_prompt() in isolationencode_prompt() in isolation
|
@DN6 @hlky would now appreciate a set of reviews on the PR. Couple of questions:
|
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.
LGTM
I agree SDXLOptionalComponentsTesterMixin and majority of test_save_load_optional_components can be removed, they would mainly be duplicates and with other recent changes we're working towards all components of a pipeline being usable in isolation which changes the context of these tests.
|
@DN6 WDYT? |
|
Some further updates regarding removing some duplicate tests:
Also, I have fixed some tests that simply has Could you take a look again @hlky? Sorry for the reiteration. |
|
Some tests are failing @sayakpaul Details
|
|
@hlky yeah I am working on them as we speak. We should now skip them now that we have removed the optional components class ( |
|
@hlky could you check now? |
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.
All good, the remaining failing tests are unrelated.
Useful test to have and the differences in encode_prompt interface is useful information for future refactors.
What does this PR do?
encode_prompt()is often used in isolation to lift off memory requirements and to also compute prompt embeddings in many trainers. It's important that we testencode_prompt()properly.This PR adds a test suite to do that. Since we cannot reliably map the outputs of
encode_prompt()into keyword arguments of a pipeline call, I propose to use theastmodule to determine the names of the variables returned from a particularencode_prompt()method. This PR is a PoC of what the changes might look like at the test level.The closest test we have currently is this:
diffusers/tests/pipelines/test_pipelines_common.py
Line 2165 in 15d4569
But, IMO, this should be extended to the other pipelines on a more general level.
TODOs
encode_prompt()to work in isolation in the pipelines if needed.SDXLOptionalComponentsTesterMixinif needed.