MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / state_dict

Method state_dict

diffusers/src/diffusers/models/lora.py:111–117  ·  view source on GitHub ↗
(self, *args, destination=None, prefix="", keep_vars=False)

Source from the content-addressed store, hash-verified

109 # overwrite PyTorch's `state_dict` to be sure that only the 'regular_linear_layer' weights are saved
110 # when saving the whole text encoder model and when LoRA is unloaded or fused
111 def state_dict(self, *args, destination=None, prefix="", keep_vars=False):
112 if self.lora_linear_layer is None:
113 return self.regular_linear_layer.state_dict(
114 *args, destination=destination, prefix=prefix, keep_vars=keep_vars
115 )
116
117 return super().state_dict(*args, destination=destination, prefix=prefix, keep_vars=keep_vars)
118
119 def _fuse_lora(self, lora_scale=1.0, safe_fusing=False):
120 if self.lora_linear_layer is None:

Callers 15

load_sub_modelFunction · 0.45
decode_to_imageMethod · 0.45
decode_to_meshMethod · 0.45
pack_weightsMethod · 0.45
save_pretrainedMethod · 0.45
from_pretrainedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected