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

Function load_model

modelscope/pipelines/cv/image_to_3d_pipeline.py:41–48  ·  view source on GitHub ↗
(cfg, ckpt, strict=True)

Source from the content-addressed store, hash-verified

39
40# Load Syncdreamer Model
41def load_model(cfg, ckpt, strict=True):
42 config = OmegaConf.load(cfg)
43 model = instantiate_from_config(config.model)
44 print(f'loading model from {ckpt} ...')
45 ckpt = torch.load(ckpt, map_location='cpu', weights_only=True)
46 model.load_state_dict(ckpt['state_dict'], strict=strict)
47 model = model.cuda().eval()
48 return model
49
50
51# Prepare Syncdreamer Input

Callers 2

__init__Method · 0.70
__init__Method · 0.50

Calls 6

instantiate_from_configFunction · 0.90
printFunction · 0.85
loadMethod · 0.45
load_state_dictMethod · 0.45
evalMethod · 0.45
cudaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…