MCPcopy
hub / github.com/OpenMotionLab/MotionGPT / instantiate_from_config

Function instantiate_from_config

mGPT/config.py:36–42  ·  view source on GitHub ↗

Instantiate object from config

(config)

Source from the content-addressed store, hash-verified

34
35
36def instantiate_from_config(config):
37 """
38 Instantiate object from config
39 """
40 if not "target" in config:
41 raise KeyError("Expected key `target` to instantiate.")
42 return get_obj_from_str(config["target"])(**config.get("params", dict()))
43
44
45def resume_config(cfg: OmegaConf):

Callers 7

mainFunction · 0.90
_get_t2m_evaluatorMethod · 0.90
_get_t2m_evaluatorMethod · 0.90
_get_t2m_evaluatorMethod · 0.90
build_dataFunction · 0.90
__init__Method · 0.90
build_modelFunction · 0.90

Calls 2

get_obj_from_strFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected