MCPcopy
hub / github.com/THUDM/CogDL / build_model

Function build_model

cogdl/models/__init__.py:33–43  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

31
32
33def build_model(args):
34 model = args.model
35 if isinstance(model, list):
36 model = model[0]
37 if model in SUPPORTED_MODELS:
38 path = ".".join(SUPPORTED_MODELS[model].split(".")[:-1])
39 module = importlib.import_module(path)
40 else:
41 raise NotImplementedError(f"Failed to import {model} model.")
42 class_name = SUPPORTED_MODELS[model].split(".")[-1]
43 return getattr(module, class_name).build_model_from_args(args)
44
45
46SUPPORTED_MODELS = {

Callers 6

2training.pyFile · 0.90
2training_cn.pyFile · 0.90
__call__Method · 0.90
__init__Method · 0.90
trainFunction · 0.90
_enhance_embMethod · 0.90

Calls 1

build_model_from_argsMethod · 0.45

Tested by

no test coverage detected