import torch def load_model(config, device, model): model = model.to(device) model_file_path = "model.pt" state = torch.load(str(model_file_path), map_location=device, weights_only=True) model.load_state_dict(state['model_state_dict']) return model