MCPcopy
hub / github.com/deepspeedai/DeepSpeedExamples / load

Method load

Megatron-LM/model/modeling.py:777–783  ·  view source on GitHub ↗
(module, prefix='')

Source from the content-addressed store, hash-verified

775 state_dict._metadata = metadata
776
777 def load(module, prefix=''):
778 local_metadata = {} if metadata is None else metadata.get(prefix[:-1], {})
779 module._load_from_state_dict(
780 state_dict, prefix, local_metadata, True, missing_keys, unexpected_keys, error_msgs)
781 for name, child in module._modules.items():
782 if child is not None:
783 load(child, prefix + name + '.')
784 load(model, prefix='' if hasattr(model, 'bert') else 'bert.')
785 if len(missing_keys) > 0:
786 logger.info("Weights of {} not initialized from pretrained model: {}".format(

Callers 9

build_dataset_Method · 0.45
build_shard_mappings_Method · 0.45
load_checkpointFunction · 0.45
from_pretrainedMethod · 0.45
__init__Method · 0.45
filename_to_urlFunction · 0.45
load_json_streamMethod · 0.45
__init__Method · 0.45
make_gpt2_sizes.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected