"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "c94ea5fff57b3ec8893f073dce61388c163afb67"
Unverified Commit 1066de8c authored by Linoy Tsaban's avatar Linoy Tsaban Committed by GitHub
Browse files

[Qwen LoRA training] fix bug when offloading (#12440)

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled

* fix bug when offload and cache_latents both enabled
parent 2d69bacb
...@@ -1338,7 +1338,7 @@ def main(args): ...@@ -1338,7 +1338,7 @@ def main(args):
batch["pixel_values"] = batch["pixel_values"].to( batch["pixel_values"] = batch["pixel_values"].to(
accelerator.device, non_blocking=True, dtype=vae.dtype accelerator.device, non_blocking=True, dtype=vae.dtype
) )
latents_cache.append(vae.encode(batch["pixel_values"]).latent_dist) latents_cache.append(vae.encode(batch["pixel_values"]).latent_dist)
if train_dataset.custom_instance_prompts: if train_dataset.custom_instance_prompts:
with offload_models(text_encoding_pipeline, device=accelerator.device, offload=args.offload): with offload_models(text_encoding_pipeline, device=accelerator.device, offload=args.offload):
prompt_embeds, prompt_embeds_mask = compute_text_embeddings( prompt_embeds, prompt_embeds_mask = compute_text_embeddings(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment