MCPcopy Create free account
hub / github.com/UCSC-VLAA/OpenVision / load

Function load

src/models/text_decoder.py:603–614  ·  view source on GitHub ↗

Load init from checkpoint, both old model and this one. +Hi-res posemb.

(init_params, init_file, model_cfg, dont_load=())

Source from the content-addressed store, hash-verified

601
602
603def 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected