clearer error on frame count mismatch
This commit is contained in:
@@ -175,11 +175,12 @@ class MMDoubleStreamBlock(nn.Module):
|
||||
|
||||
# Apply RoPE if needed.
|
||||
if freqs_cis is not None:
|
||||
img_qq, img_kk = apply_rotary_emb(img_q, img_k, freqs_cis, head_first=False)
|
||||
assert (
|
||||
img_qq.shape == img_q.shape and img_kk.shape == img_k.shape
|
||||
), f"img_kk: {img_qq.shape}, img_q: {img_q.shape}, img_kk: {img_kk.shape}, img_k: {img_k.shape}"
|
||||
img_q, img_k = img_qq, img_kk
|
||||
img_q, img_k = apply_rotary_emb(img_q, img_k, freqs_cis, head_first=False)
|
||||
#img_q, img_k = img_qq, img_kk
|
||||
#assert (
|
||||
# img_qq.shape == img_q.shape and img_kk.shape == img_k.shape
|
||||
#), f"img_kk: {img_qq.shape}, img_q: {img_q.shape}, img_kk: {img_kk.shape}, img_k: {img_k.shape}"
|
||||
|
||||
|
||||
# Prepare txt for attention.
|
||||
txt_modulated = self.txt_norm1(txt)
|
||||
|
||||
@@ -1087,7 +1087,7 @@ class HyVideoSampler:
|
||||
)
|
||||
if (num_frames - 1) % 4 != 0:
|
||||
raise ValueError(
|
||||
f"`video_length-1` must be a multiple of 4, got {num_frames}"
|
||||
f"`video_length - 1 (that's minus one frame)` must be a multiple of 4, got {num_frames}"
|
||||
)
|
||||
|
||||
log.info(
|
||||
@@ -1101,6 +1101,8 @@ class HyVideoSampler:
|
||||
transformer, num_frames, target_height, target_width
|
||||
)
|
||||
n_tokens = freqs_cos.shape[0]
|
||||
freqs_cos = freqs_cos.to(dtype).to(device)
|
||||
freqs_sin = freqs_sin.to(dtype).to(device)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class HyVideoInverseSampler:
|
||||
)
|
||||
if (num_frames - 1) % 4 != 0:
|
||||
raise ValueError(
|
||||
f"`video_length-1` must be a multiple of 4, got {num_frames}"
|
||||
f"`video_length - 1 (that's minus one frame)` must be a multiple of 4, got {num_frames}"
|
||||
)
|
||||
|
||||
log.info(
|
||||
@@ -320,7 +320,7 @@ class HyVideoReSampler:
|
||||
)
|
||||
if (num_frames - 1) % 4 != 0:
|
||||
raise ValueError(
|
||||
f"`video_length-1` must be a multiple of 4, got {num_frames}"
|
||||
f"`video_length - 1 (that's minus one frame)` must be a multiple of 4, got {num_frames}"
|
||||
)
|
||||
|
||||
log.info(
|
||||
@@ -498,7 +498,7 @@ class HyVideoPromptMixSampler:
|
||||
)
|
||||
if (num_frames - 1) % 4 != 0:
|
||||
raise ValueError(
|
||||
f"`video_length-1` must be a multiple of 4, got {num_frames}"
|
||||
f"`video_length - 1 (that's minus one frame)` must be a multiple of 4, got {num_frames}"
|
||||
)
|
||||
|
||||
log.info(
|
||||
|
||||
Reference in New Issue
Block a user