MCPcopy Create free account
hub / github.com/modelscope/modelscope / load

Function load

modelscope/utils/checkpoint.py:264–272  ·  view source on GitHub ↗
(module: nn.Module, prefix='')

Source from the content-addressed store, hash-verified

262 else:
263
264 def load(module: nn.Module, prefix=''):
265 local_metadata = {} if metadata is None else metadata.get(
266 prefix[:-1], {})
267 args = (state_dict, prefix, local_metadata, True, [], [],
268 error_msgs)
269 module._load_from_state_dict(*args)
270 for name, child in module._modules.items():
271 if child is not None:
272 load(child, prefix + name + '.')
273
274 load(model, prefix=start_prefix)
275

Callers 1

Calls 3

getMethod · 0.45
_load_from_state_dictMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…