[Tests] add a test suite to check if loading from subfolder works as expected.#8422
[Tests] add a test suite to check if loading from subfolder works as expected.#8422
Conversation
|
|
||
| self.assertTrue(torch.allclose(base_output[0], new_output[0], atol=1e-5)) | ||
|
|
||
| def test_loading_from_subfolder(self): |
There was a problem hiding this comment.
I don't think this test will catch the error in #8416 since we only have issue when it loads from the legacy model class name,
e.g. for pixart model_class = PixArtTransformer2DModel
I left a comment here https://github.com/huggingface/diffusers/pull/7647/files#r1631917736
I think we should keep the tests with legacy class name so we will be abe to catch these errors
|
@yiyixuxu do the recent changes work for you? (Have tested them too) Regardless, I think having a separate suite for subfolder tests wouldn't be too bad. |
|
@yiyixuxu a gentle ping here. |
|
|
||
| def test_dit_legacy_class_loading_from_subfolder(self): | ||
| ckpt_id = "facebook/DiT-XL-2-512" | ||
| transformer = Transformer2DModel.from_pretrained(ckpt_id, subfolder="transformer") |
There was a problem hiding this comment.
Is there a checkpoint where the norm_type isn't one of ada_norm_zero or ada_norm_single? I think we should test that the Transformer2DModel object is returned in that case and functions normally. Perhaps another test file test_models_transformer_2d is needed.
There was a problem hiding this comment.
That is a different scope. Feel free to open a PR separately.
| assert not np.allclose(image_slice, no_res_bin_image_slice, atol=1e-4, rtol=1e-4) | ||
|
|
||
| def test_pixart_512_without_resolution_binning(self): | ||
| def test_pixart_512_without_resolution_binning_legacy_class(self): |
There was a problem hiding this comment.
we are not testing the new class here?
There was a problem hiding this comment.
Being tested here:
And here:
I thought that would suffice?
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
What does this PR do?
To prevent things like this from happening: #8416