(self, path, strict=True)
| 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): |
no test coverage detected