MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / load_state_dict_from_bin

Function load_state_dict_from_bin

diffsynth/models/utils.py:82–88  ·  view source on GitHub ↗
(file_path, torch_dtype=None)

Source from the content-addressed store, hash-verified

80
81
82def load_state_dict_from_bin(file_path, torch_dtype=None):
83 state_dict = torch.load(file_path, map_location="cpu", weights_only=True)
84 if torch_dtype is not None:
85 for i in state_dict:
86 if isinstance(state_dict[i], torch.Tensor):
87 state_dict[i] = state_dict[i].to(torch_dtype)
88 return state_dict
89
90
91def search_for_embeddings(state_dict):

Callers 1

load_state_dictFunction · 0.85

Calls 2

loadMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected