Refactor model loading

This commit is contained in:
kijai
2025-08-16 16:03:15 +03:00
parent e5b0b53265
commit 7fc5ec305d
7 changed files with 343 additions and 227 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ def _replace_linear(model, compute_dtype, state_dict, prefix="", patches=None, s
module_prefix = prefix + name + "."
_replace_linear(module, compute_dtype, state_dict, module_prefix, patches, scale_weights)
if isinstance(module, nn.Linear):
if isinstance(module, nn.Linear) and "loras" not in module_prefix:
in_features = state_dict[module_prefix + "weight"].shape[1]
out_features = state_dict[module_prefix + "weight"].shape[0]
if scale_weights is not None: