MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / load_checkpoint

Function load_checkpoint

lit_gpt/utils.py:360–368  ·  view source on GitHub ↗
(
    fabric: L.Fabric, model: nn.Module, checkpoint_path: Path, strict: bool = True
)

Source from the content-addressed store, hash-verified

358
359
360def load_checkpoint(
361 fabric: L.Fabric, model: nn.Module, checkpoint_path: Path, strict: bool = True
362) -> None:
363 if isinstance(fabric.strategy, FSDPStrategy):
364 fabric.load_raw(checkpoint_path, model, strict=strict)
365 else:
366 state_dict = lazy_load(checkpoint_path)
367 state_dict = state_dict.get('model', state_dict)
368 model.load_state_dict(state_dict, strict=strict)
369
370
371def flops_per_param(

Callers 1

mainFunction · 0.90

Calls 1

lazy_loadClass · 0.85

Tested by

no test coverage detected