MCPcopy
hub / github.com/huggingface/diffusers / get_state_dict

Function get_state_dict

scripts/convert_cosmos_to_diffusers.py:568–576  ·  view source on GitHub ↗
(saved_dict: Dict[str, Any])

Source from the content-addressed store, hash-verified

566
567
568def get_state_dict(saved_dict: Dict[str, Any]) -> dict[str, Any]:
569 state_dict = saved_dict
570 if "model" in saved_dict.keys():
571 state_dict = state_dict["model"]
572 if "module" in saved_dict.keys():
573 state_dict = state_dict["module"]
574 if "state_dict" in saved_dict.keys():
575 state_dict = state_dict["state_dict"]
576 return state_dict
577
578
579def convert_transformer(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…