Uh oh!
There was an error while loading. Please reload this page.
[LoRA] add LoRA support to HiDream and fine-tuning script - #11281
Conversation
HuggingFaceDocBuilderDev
commented
Apr 10, 2025
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
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.
Also, in encode_prompt(),
prompt_embeds= [t5_prompt_embeds, llama3_prompt_embeds]Would prompt_embeds = prompt_embeds.to(accelerator.device) work here.
sayakpaul
left a comment
There was a problem hiding this comment.
Thanks a lot for this!
I have left some clarification questions. LMK if they make sense.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bagheera <59658056+bghira@users.noreply.github.com>
hlky
left a comment
There was a problem hiding this comment.
Just a few comments, will review again when out of draft, thanks @linoytsaban!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: hlky <hlky@hlky.ac>
Co-authored-by: hlky <hlky@hlky.ac>
linoytsaban
commented
Apr 21, 2025
@bot /style |
Style fixes have been applied. View the workflow run here. |
vladmandic
commented
Apr 22, 2025
follow-up issue ##11383 |
add lora training for Hi Dream Image
memory optimizations:
example -