Bin-0815's picture
Release all GRADE models, checkpoints, and reviewed evaluation code (part 2)
f348660 verified
Raw History Blame Contribute Delete
282 Bytes
import torch
from safetensors.torch import load_file
class BaseModel(torch.nn.Module):
def load(self, path):
"""Load model from file.
Args:
path (str): file path
"""
self.load_state_dict(load_file(path, device="cpu"), strict=True)