Use print instead of logger for weight load debug

This commit is contained in:
2026-05-18 23:30:58 +00:00
parent a6f61bda5d
commit 9d016aa1c0

View File

@@ -1577,14 +1577,13 @@ class DeepseekV4Model(nn.Module):
try:
weight_loader(param, loaded_weight)
except (AssertionError, RuntimeError) as e:
logger.error(
"Failed to load weight %s: param shape=%s, "
"loaded shape=%s, dtype=%s, error=%s",
name,
param.data.shape if hasattr(param, 'data') else '?',
loaded_weight.shape,
loaded_weight.dtype,
e,
print(
f"WEIGHT_LOAD_FAIL: name={name} "
f"param_shape={param.data.shape if hasattr(param, 'data') else '?'} "
f"loaded_shape={loaded_weight.shape} "
f"loaded_dtype={loaded_weight.dtype} "
f"error={e}",
flush=True,
)
raise