From f35c36c16d904e409fed2e03c9620e34d402bc84 Mon Sep 17 00:00:00 2001 From: Aryan Date: Mon, 9 Sep 2024 23:45:47 +0200 Subject: [PATCH] use correct lora scaling for final test pipeline --- examples/cogvideo/train_cogvideox_lora.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/cogvideo/train_cogvideox_lora.py b/examples/cogvideo/train_cogvideox_lora.py index f3badb6928..ba7bc27bad 100644 --- a/examples/cogvideo/train_cogvideox_lora.py +++ b/examples/cogvideo/train_cogvideox_lora.py @@ -1151,7 +1151,6 @@ def main(args): ) def encode_video(video): - print(video.shape) video = video.to(accelerator.device, dtype=vae.dtype).unsqueeze(0) video = video.permute(0, 2, 1, 3, 4) # [B, C, F, H, W] latent_dist = vae.encode(video).latent_dist @@ -1475,7 +1474,9 @@ def main(args): pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config) # Load LoRA weights - pipe.load_lora_weights(args.output_dir) + lora_scaling = args.lora_alpha / args.rank + pipe.load_lora_weights(args.output_dir, adapter_name="cogvideox-lora") + pipe.set_adapters(["cogvideox-lora"], [lora_scaling]) # Run inference validation_outputs = []