MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / update_state_dict_inplace

Function update_state_dict_inplace

tools/convert_weight_sat2hf.py:156–157  ·  view source on GitHub ↗
(state_dict: Dict[str, Any], old_key: str, new_key: str)

Source from the content-addressed store, hash-verified

154
155# Function to update the state_dict with new key assignments in-place
156def update_state_dict_inplace(state_dict: Dict[str, Any], old_key: str, new_key: str) -> Dict[str, Any]:
157 state_dict[new_key] = state_dict.pop(old_key)
158
159
160# Function to convert a transformer checkpoint to the CogVideoX format

Callers 2

convert_transformerFunction · 0.85
convert_vaeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected