File size: 270 Bytes
90710f0
 
 
 
5021385
90710f0
 
 
 
1
2
3
4
5
6
7
8
9
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