-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[Tests] Add combined pipeline tests #4869
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
The documentation is not available anymore as the PR was closed or merged. |
|
||
|
||
class CombinedPipelineFastTest(unittest.TestCase): | ||
def modelcard_has_connected_pipeline(self, model_id): |
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.
Damn! I would have never thought of testing it like that.
prior_comps = prior.components | ||
decoder_comps = decoder.components | ||
for k, component in pipeline.components.items(): | ||
if k.startswith("prior_"): | ||
k = k[6:] | ||
comp = prior_comps[k] | ||
else: | ||
comp = decoder_comps[k] | ||
|
||
if isinstance(component, torch.nn.Module): | ||
assert state_dicts_almost_equal(component.state_dict(), comp.state_dict()) | ||
elif hasattr(component, "config"): | ||
assert dict(component.config) == dict(comp.config) | ||
else: | ||
assert component.__class__ == comp.__class__ |
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.
Clean!
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 tests! Thanks for adding.
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.
super cool!
* [Tests] Add combined pipeline tests * Update tests/pipelines/kandinsky_v22/test_kandinsky.py
What does this PR do?
The PR adds tests for the loading logic of connected pipelines and thereby fixes: #4289