MCPcopy Create free account
hub / github.com/GeWu-Lab/AnyTouch2 / load_model_from_multi_old

Function load_model_from_multi_old

sparsh/train_task.py:65–77  ·  view source on GitHub ↗
(ckpt, model)

Source from the content-addressed store, hash-verified

63 return model
64
65def load_model_from_multi_old(ckpt, model):
66 new_ckpt = {}
67 for key,item in ckpt.items():
68 if "touch_model" in key or "touch_projection" in key or "sensor_token" in key and "sensor_token_proj" not in key:
69 new_ckpt[key.replace('touch_mae_model.','')] = copy.deepcopy(item)
70
71 if "video_patch_embedding" in key:
72 new_key = key.replace('touch_mae_model.','')
73 new_ckpt[new_key.replace("video_patch_embedding","touch_model.embeddings.patch_embedding")] = copy.deepcopy(item)
74
75 model.load_state_dict(new_ckpt, strict=True)
76
77 return model
78
79def load_model_from_clip(ckpt, model):
80 new_ckpt = {}

Callers

nothing calls this directly

Calls 1

load_state_dictMethod · 0.80

Tested by

no test coverage detected