Handle the None case for the dtype

There are paths where this can be None. Default to fp32 in that case.
This commit is contained in:
Rattus 2025-12-09 08:32:14 +10:00
parent 935493f6c1
commit 5c781dfd98

View File

@ -139,6 +139,8 @@ def low_vram_patch_estimate_vram(model, key):
if weight is None: if weight is None:
return 0 return 0
model_dtype = getattr(model, "manual_cast_dtype", torch.float32) model_dtype = getattr(model, "manual_cast_dtype", torch.float32)
if model_dtype is None:
model_dtype = torch.float32
return weight.numel() * model_dtype.itemsize * LOWVRAM_PATCH_ESTIMATE_MATH_FACTOR return weight.numel() * model_dtype.itemsize * LOWVRAM_PATCH_ESTIMATE_MATH_FACTOR
def get_key_weight(model, key): def get_key_weight(model, key):