T-CLM2 / loadmodel.py
Mayura01's picture
Update loadmodel.py
5021385 verified
Raw History Blame Contribute Delete
270 Bytes
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