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

Method remap_key

diffusers/src/diffusers/loaders/utils.py:41–48  ·  view source on GitHub ↗
(key, state_dict)

Source from the content-addressed store, hash-verified

39 return new_state_dict
40
41 def remap_key(key, state_dict):
42 for k in self.split_keys:
43 if k in key:
44 return key.split(k)[0] + k
45
46 raise ValueError(
47 f"There seems to be a problem with the state_dict: {set(state_dict.keys())}. {key} has to have one of {self.split_keys}."
48 )
49
50 def map_from(module, state_dict, *args, **kwargs):
51 all_keys = list(state_dict.keys())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected