-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[LoRA] enable LoRA for Mochi-1 #9943
base: main
Are you sure you want to change the base?
Conversation
@@ -2362,7 +2362,7 @@ def save_lora_weights( | |||
|
|||
class CogVideoXLoraLoaderMixin(LoraBaseMixin): | |||
r""" | |||
Load LoRA layers into [`CogVideoXTransformer3DModel`]. Specific to [`CogVideoX`]. | |||
Load LoRA layers into [`CogVideoXTransformer3DModel`]. Specific to [`CogVideoXPipeline`]. |
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.
Unrelated change but doesn't hurt I guess.
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.
Looks okay to fix here
@@ -2667,6 +2667,314 @@ def unfuse_lora(self, components: List[str] = ["transformer", "text_encoder"], * | |||
super().unfuse_lora(components=components) | |||
|
|||
|
|||
class Mochi1LoraLoaderMixin(LoraBaseMixin): |
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.
A copy-paste of the Cog LoRA loader classes, indicated by the "Copied from ..." comments.
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. |
def test_simple_inference_with_text_denoiser_lora_unfused(self): | ||
super().test_simple_inference_with_text_denoiser_lora_unfused(expected_atol=9e-3) | ||
|
||
@unittest.skip("Not supported in Mochi.") |
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.
Looks good since not supporting T5 finetuning!
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.
Looks great! Don't see any major differences in the lora mixin, so I think everything should be good to merge once the finetuning script is working - going to take a look at it now, thanks!
@a-r-r-o-w thanks! Do you think it could make sense to merge regardless with the tests, etc.? Because this will also allow others to experiment from |
What does this PR do?
Needed for fine-tuning.