MCPcopy Create free account
hub / github.com/modelscope/DiffSynth-Studio / load_state_dict

Function load_state_dict

diffsynth/models/utils.py:65–69  ·  view source on GitHub ↗
(file_path, torch_dtype=None, device="cpu")

Source from the content-addressed store, hash-verified

63
64
65def load_state_dict(file_path, torch_dtype=None, device="cpu"):
66 if file_path.endswith(".safetensors"):
67 return load_state_dict_from_safetensors(file_path, torch_dtype=torch_dtype, device=device)
68 else:
69 return load_state_dict_from_bin(file_path, torch_dtype=torch_dtype, device=device)
70
71
72def load_state_dict_from_safetensors(file_path, torch_dtype=None, device="cpu"):

Calls 2

load_state_dict_from_binFunction · 0.85

Tested by

no test coverage detected