-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[LoRA] add LoRA support to HiDream and fine-tuning script #11281
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 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 compute_text_embeddings(prompt, text_encoders, tokenizers): | ||
with torch.no_grad(): | ||
prompt_embeds, pooled_prompt_embeds = encode_prompt( | ||
text_encoders, tokenizers, prompt, args.max_sequence_length | ||
) | ||
prompt_embeds = prompt_embeds.to(accelerator.device) | ||
pooled_prompt_embeds = pooled_prompt_embeds.to(accelerator.device) | ||
return prompt_embeds, pooled_prompt_embeds |
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.
Hundred percent not a blocker for this PR. But we could allow users to drop out the other text encoders by zeroing those embeds.
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.
Also, in encode_prompt()
,
prompt_embeds = [t5_prompt_embeds, llama3_prompt_embeds]
Would prompt_embeds = prompt_embeds.to(accelerator.device)
work here.
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.
Thanks a lot for this!
I have left some clarification questions. LMK if they make sense.
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.
Just a few comments, will review again when out of draft, thanks @linoytsaban!
Co-authored-by: hlky <[email protected]>
Co-authored-by: hlky <[email protected]>
Hi @Nerogar!
Specifically we encountered an issue with |
@bot /style |
Style fixes have been applied. View the workflow run here. |
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.
Thank you!
follow-up issue ##11383 |
add lora training for Hi Dream Image
memory optimizations:
example -