MCPcopy Create free account
hub / github.com/HA-Transformer/MAT / load_pretrained_component_from_model

Function load_pretrained_component_from_model

fairseq/checkpoint_utils.py:320–348  ·  view source on GitHub ↗

Load a pretrained FairseqEncoder or FairseqDecoder from checkpoint into the provided `component` object. If state_dict fails to load, there may be a mismatch in the architecture of the corresponding `component` found in the `checkpoint` file.

(
    component: Union[FairseqEncoder, FairseqDecoder], checkpoint: str
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 3

load_checkpoint_to_cpuFunction · 0.85
existsMethod · 0.45
load_state_dictMethod · 0.45

Tested by

no test coverage detected