(weight_path:str)
| 23 | import torch |
| 24 | |
| 25 | def load_weights(weight_path:str): |
| 26 | suffix = weight_path.split('.')[-1] |
| 27 | if suffix != 'pth': |
| 28 | print("Unsupported weight file: Unrecognized format %s " % suffix) |
| 29 | exit(-1) |
| 30 | return torch.load(weight_path, map_location="cpu") |
| 31 | |
| 32 | class ViTINT8PluginLoader: |
| 33 | def __init__(self, plugin_path) -> None: |