(mp_rank, load_dir, tag='')
| 63 | |
| 64 | |
| 65 | def pre_load(mp_rank, load_dir, tag=''): |
| 66 | load_path = _get_ckpt_name(mp_rank, load_dir, tag) |
| 67 | checkpoint = torch.load( |
| 68 | load_path, |
| 69 | map_location=lambda storage, loc: storage, |
| 70 | weights_only=True) |
| 71 | return checkpoint['module'] if 'module' in checkpoint else checkpoint |
| 72 | |
| 73 | |
| 74 | def _load_checkpoint(model, |
no test coverage detected
searching dependent graphs…