MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / load_param

Method load_param

codegeex/mindspore/src/pangu_alpha.py:430–439  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

428 r"""load the weights from the checkpoint"""
429
430 def load_param(path):
431 if os.path.exists(path):
432 p_table = np.load(path)
433 table_param = Tensor(p_table, mstype.float32)
434 else:
435 raise ValueError(
436 f"{path} file not exits, "
437 f"please check whether embedding file exit."
438 )
439 return table_param
440
441 # three embedding needed to be loaded
442 # Loading the embedding table from the ckpt path:

Callers

nothing calls this directly

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected