Load init from checkpoint, both old model and this one. +Hi-res posemb.
(init_params, init_file, model_cfg, dont_load=())
| 601 | |
| 602 | |
| 603 | def load(init_params, init_file, model_cfg, dont_load=()): # pylint: disable=invalid-name because we had to CamelCase above. |
| 604 | """Load init from checkpoint, both old model and this one. +Hi-res posemb.""" |
| 605 | del model_cfg |
| 606 | |
| 607 | restored_params = utils.load_params(None, init_file) |
| 608 | |
| 609 | # possibly use the random init for some of the params (such as, the head). |
| 610 | restored_params = common.merge_params(restored_params, init_params, dont_load=dont_load) |
| 611 | |
| 612 | from helpers.utils import recover_dtype |
| 613 | restored_params = jax.tree_map(recover_dtype, restored_params) |
| 614 | return restored_params |
nothing calls this directly
no outgoing calls
no test coverage detected