(self, path, map_location=None)
| 115 | return filenames |
| 116 | |
| 117 | def load_pretrain(self, path, map_location=None): |
| 118 | if "s3://" not in path: |
| 119 | assert os.path.exists(path), f"No such file: {path}" |
| 120 | return torch.load(path, map_location=map_location, weights_only=True) |
| 121 | elif "http://" in path: |
| 122 | return torch.hub.load_state_dict_from_url(path, map_location=map_location) |
| 123 | else: |
| 124 | self.check_init() |
| 125 | |
| 126 | file_bytes = self.client.get(path) |
| 127 | buffer = io.BytesIO(file_bytes) |
| 128 | res = torch.load(buffer, map_location=map_location, weights_only=True) |
| 129 | return res |
| 130 | |
| 131 | @staticmethod |
| 132 | def load(path, **kwargs): |
no test coverage detected