MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / load_state_dict

Function load_state_dict

utils/common.py:76–85  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

74
75
76def load_state_dict(path):
77 path = str(path)
78 if path.endswith('.safetensors'):
79 sd = load_safetensors(path)
80 else:
81 sd = torch.load(path, weights_only=True)
82 for key in sd:
83 if key.endswith('scale_input') or key.endswith('scale_weight'):
84 raise ValueError('fp8_scaled weights are not supported. Please use bf16 or normal fp8 weights.')
85 return sd
86
87
88def iterate_safetensors(path):

Callers 12

load_custom_video_vaeFunction · 0.90
load_diffusion_modelMethod · 0.90
load_diffusion_modelMethod · 0.90
__init__Method · 0.90
load_custom_video_vaeFunction · 0.90
__init__Method · 0.90
load_diffusion_modelMethod · 0.90
_video_vaeFunction · 0.90
__init__Method · 0.90
load_diffusion_modelMethod · 0.90
load_adapter_weightsMethod · 0.90
from_pretrainedMethod · 0.90

Calls 1

load_safetensorsFunction · 0.85

Tested by 1

load_custom_video_vaeFunction · 0.72