MCPcopy Create free account
hub / github.com/FusionBrainLab/SONAR-LLM / load_checkpoint_for_inference

Function load_checkpoint_for_inference

generate.py:61–64  ·  view source on GitHub ↗
(ckpt_path, model, device="cpu")

Source from the content-addressed store, hash-verified

59
60
61def load_checkpoint_for_inference(ckpt_path, model, device="cpu"):
62 checkpoint = torch.load(ckpt_path, map_location=device)
63 raw_model = model.module if hasattr(model, "module") else model
64 raw_model.load_state_dict(checkpoint["model_state_dict"], strict=False)
65
66
67@torch.no_grad()

Callers 1

generate.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected