mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-03 22:31:42 -08:00
use assign=True for some cases
This commit is contained in:
parent
eee7294200
commit
6675d1f090
1 changed files with 5 additions and 0 deletions
|
|
@ -176,6 +176,11 @@ class LoadStateDictOnMeta(ReplaceHelper):
|
|||
def load_from_state_dict(original, module, state_dict, prefix, *args, **kwargs):
|
||||
used_param_keys = []
|
||||
|
||||
if type(module) in (torch.nn.Linear, torch.nn.Conv2d, torch.nn.GroupNorm, torch.nn.LayerNorm,):
|
||||
# HACK add assign=True to local_metadata for some cases
|
||||
args[0]['assign_to_params_buffers'] = True
|
||||
|
||||
|
||||
for name, param in module._parameters.items():
|
||||
if param is None:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue