Add from_single_file support to ErnieImageTransformer2DModel#13727
Conversation
|
@akshan-main do you have an example snippet to verify that we can load the model? |
|
@DN6 there's no public single-file ernie checkpoint yet, so I verified by saving the sharded Output: |
|
Friendly ping @DN6 |
DN6
left a comment
There was a problem hiding this comment.
Sorry for the delay. One minor change requested.
| for k in list(checkpoint.keys()): | ||
| converted_state_dict[k] = checkpoint.pop(k) |
There was a problem hiding this comment.
We don't really need this part?
There was a problem hiding this comment.
Oh yeah! I followed the flux/chroma return shape (separate converted_state_dict) but ernie doesn't need any further remapping. Fixed!
|
@DN6 all good now! |
|
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. |
* Add from_single_file support to ErnieImageTransformer2DModel * drop redundant copy loop
What does this PR do?
Fixes #13722.
ErnieImageTransformer2DModeldoes not implementfrom_single_file, unlike other models (Flux, Chroma, Z-Image, etc.), so loading a single-file checkpoint (e.g. a OneTrainer finetune) errors withAttributeError.Adding standard
FromOriginalModelMixinto the class and register a minimal checkpoint converter that strips the commonmodel.diffusion_model.prefix(same shape as the Flux/Chroma converters)Fixes #13722
Before submitting
Who can review?
@DN6 @sayakpaul