(path)
| 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: |