MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / 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

forward_stepFunction · 0.45
get_argsFunction · 0.45
process_config_to_argsFunction · 0.45
load_jsonFunction · 0.45
decode_latentsFunction · 0.45
load_model_from_configFunction · 0.45
_init_loraMethod · 0.45
init_and_load_fromMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 5

load_state_dictMethod · 0.95
existsMethod · 0.80
getMethod · 0.80
existsFunction · 0.70
printFunction · 0.50

Tested by

no test coverage detected