Skip to content

Commit f39796f

Browse files
committed
missing key debug
1 parent f05c97b commit f39796f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/maxdiffusion/models/wan/wan_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,18 @@ def load_base_wan_transformer(
254254
random_flax_state_dict[string_tuple] = flattened_dict[key]
255255
del flattened_dict
256256
norm_added_q_buffer = {}
257+
print(f"DEBUG: Total keys found in checkpoint: {len(tensors)}")
257258
for pt_key, tensor in tensors.items():
259+
if "norm_added_q" in pt_key:
260+
print(f"DEBUG: Found norm_added_q key: {pt_key}")
258261
renamed_pt_key = rename_key(pt_key)
259262
if "norm_added_q" in pt_key:
260263
parts = pt_key.split(".")
261-
block_idx = int(parts[1])
264+
try:
265+
block_idx = int(parts[1])
266+
except ValueError:
267+
print(f"DEBUG: Failed to parse index from {pt_key}")
268+
continue
262269
tensor = tensor.T
263270
norm_added_q_buffer[block_idx] = tensor
264271
continue

0 commit comments

Comments
 (0)