31 unmodified lines3233343536373831 unmodified linesdef initialize(path="models/model.pt"): model = DistilBERTSent() model.load_state_dict(torch.load(path, map_location=device)) model.to(device) model.eval() return model