Only convert layers that actually have scaled weights...
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ def convert_fp8_scaled_linear(module, sd, original_dtype, params_to_keep={}, pat
|
||||
lora = (lora_diffs, lora_strengths)
|
||||
setattr(submodule, "lora", lora)
|
||||
|
||||
if isinstance(submodule, nn.Linear) and (has_scale or has_fp8_weight):
|
||||
if isinstance(submodule, nn.Linear) and (has_scale and has_fp8_weight):
|
||||
original_forward = submodule.forward
|
||||
setattr(submodule, "original_forward", original_forward)
|
||||
setattr(submodule, "forward", lambda input, m=submodule: fp8_scaled_linear_forward(m, original_dtype, input))
|
||||
|
||||
@@ -651,9 +651,11 @@ class WanVideoModelLoader:
|
||||
quantization = "fp8_e5m2"
|
||||
break
|
||||
|
||||
if "scaled_fp8" in sd and quantization != "fp8_e4m3fn_scaled":
|
||||
raise ValueError("The model is a scaled fp8 model, please set quantization to 'fp8_e4m3fn_scaled'")
|
||||
|
||||
if merge_loras and "scaled" in quantization:
|
||||
raise ValueError("scaled models currently do not support merging LoRAs, please disable merging or use a non-scaled model")
|
||||
|
||||
|
||||
if "vace_blocks.0.after_proj.weight" in sd and not "patch_embedding.weight" in sd:
|
||||
raise ValueError("You are attempting to load a VACE module as a WanVideo model, instead you should use the vace_model input and matching T2V base model")
|
||||
|
||||
Reference in New Issue
Block a user