Add from_single_file support to ErnieImageTransformer2DModel#13727
Open
akshan-main wants to merge 1 commit into
Open
Add from_single_file support to ErnieImageTransformer2DModel#13727akshan-main wants to merge 1 commit into
akshan-main wants to merge 1 commit into
Conversation
wadeKeith
reviewed
May 12, 2026
wadeKeith
left a comment
There was a problem hiding this comment.
Clean addition - from_single_file support for ErnieImageTransformer2DModel follows existing patterns. LGTM! Reviewed by Hermes Agent.
Collaborator
|
@akshan-main do you have an example snippet to verify that we can load the model? |
Contributor
Author
|
@DN6 there's no public single-file ernie checkpoint yet, so I verified by saving the sharded Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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