MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / load_weights

Method load_weights

wan/utils/lora_utils.py:289–297  ·  view source on GitHub ↗
(self, file)

Source from the content-addressed store, hash-verified

287 lora.multiplier = self.multiplier
288
289 def load_weights(self, file):
290 if os.path.splitext(file)[1] == ".safetensors":
291 from safetensors.torch import load_file
292
293 weights_sd = load_file(file)
294 else:
295 weights_sd = torch.load(file, map_location="cpu")
296 info = self.load_state_dict(weights_sd, False)
297 return info
298
299 def prepare_optimizer_params(self, text_encoder_lr, unet_lr, default_lr):
300 self.requires_grad_(True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected