fix: apply CodeRabbit auto-fixes

Fixed 2 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
This commit is contained in:
coderabbitai[bot]
2026-07-07 14:35:48 -07:00
committed by SolitaryThinker
co-authored by CodeRabbit
parent 4c42a73098
commit eaf0f6a5b3
2 changed files with 11 additions and 1 deletions
@@ -76,6 +76,12 @@ class Kandinsky5T2VConfig(PipelineConfig):
vae_tiling: bool = True
def __post_init__(self) -> None:
if len(self.text_encoder_configs) != 2:
raise ValueError(
f"Kandinsky5 pipeline requires exactly 2 text encoders (qwen and clip), "
f"but got {len(self.text_encoder_configs)} encoder(s)."
)
self.vae_config.load_encoder = False
self.vae_config.load_decoder = True
+5 -1
View File
@@ -2,6 +2,8 @@
from __future__ import annotations
import contextlib
import torch
from diffusers.utils.torch_utils import randn_tensor
from tqdm.auto import tqdm
@@ -184,7 +186,9 @@ class Kandinsky5DenoisingStage(PipelineStage):
continue
t_expand = timestep.unsqueeze(0).repeat(latents.shape[0]).to(device=device, dtype=target_dtype)
with torch.autocast(device_type="cuda", dtype=target_dtype, enabled=autocast_enabled):
autocast_ctx = (torch.autocast(device_type="cuda", dtype=target_dtype, enabled=autocast_enabled)
if device.type == "cuda" else contextlib.nullcontext())
with autocast_ctx:
pred_velocity = self.transformer(
hidden_states=latents.to(dtype=target_dtype),
encoder_hidden_states=prompt_embeds,