MCPcopy
hub / github.com/zai-org/CogVideo / load

Method load

sat/sgm/modules/autoencoding/magvit2_pytorch.py:1367–1380  ·  view source on GitHub ↗
(self, path, strict=True)

Source from the content-addressed store, hash-verified

1365 torch.save(pkg, str(path))
1366
1367 def load(self, path, strict=True):
1368 path = Path(path)
1369 assert path.exists()
1370
1371 pkg = torch.load(str(path))
1372 state_dict = pkg.get("model_state_dict")
1373 version = pkg.get("version")
1374
1375 assert exists(state_dict)
1376
1377 if exists(version):
1378 print(f"loading checkpointed tokenizer from version {version}")
1379
1380 self.load_state_dict(state_dict, strict=strict)
1381
1382 @beartype
1383 def encode(self, video: Tensor, quantize=False, cond: Optional[Tensor] = None, video_contains_first_frame=True):

Callers 15

convert_transformerFunction · 0.80
convert_vaeFunction · 0.80
export_lora_weightFunction · 0.80
decode_videoFunction · 0.80
load_torch_fileFunction · 0.80
load_modelMethod · 0.80
load_modelMethod · 0.80
forward_stepFunction · 0.80
get_argsFunction · 0.80
process_config_to_argsFunction · 0.80
load_model_from_configFunction · 0.80
_init_loraMethod · 0.80

Calls 2

load_state_dictMethod · 0.95
existsFunction · 0.70

Tested by

no test coverage detected