MCPcopy Create free account
hub / github.com/baidu/DDParser / load

Function load

ddparser/parser/model.py:254–263  ·  view source on GitHub ↗

Loading model

(path, model=None, mode="evaluate")

Source from the content-addressed store, hash-verified

252
253
254def load(path, model=None, mode="evaluate"):
255 """Loading model"""
256 if model is None:
257 with open(path + ".args", "rb") as f:
258 args = ArgConfig(["--None"])
259 args.namespace = pickle.load(f)
260 model = Model(args)
261 model_state, _ = fluid.load_dygraph(path)
262 model.set_dict(model_state)
263 return model

Callers 5

trainFunction · 0.90
evaluateFunction · 0.90
predictFunction · 0.90
predict_queryFunction · 0.90
__init__Method · 0.90

Calls 3

ArgConfigClass · 0.90
ModelClass · 0.85
loadMethod · 0.45

Tested by

no test coverage detected