MCPcopy Index your code
hub / github.com/VisionXLab/OF-Diff / instantiate_from_config

Function instantiate_from_config

ldm/util.py:72–79  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

70
71
72def instantiate_from_config(config):
73 if not "target" in config:
74 if config == '__is_first_stage__':
75 return None
76 elif config == "__is_unconditional__":
77 return None
78 raise KeyError("Expected key `target` to instantiate.")
79 return get_obj_from_str(config["target"])(**config.get("params", dict()))
80
81
82def get_obj_from_str(string, reload=False):

Callers 11

__init__Method · 0.90
__init__Method · 0.90
configure_optimizersMethod · 0.90
__init__Method · 0.90
instantiate_low_stageMethod · 0.90
__init__Method · 0.90
instantiate_low_stageMethod · 0.90
__init__Method · 0.90
create_modelFunction · 0.90

Calls 1

get_obj_from_strFunction · 0.85

Tested by

no test coverage detected