how to save, Load and Finetune the model
Lokeshwaran-M opened this issue · comments
Lokeshwaran M commented
Model :
model = LanguageModel()
To Save
with open('model.pkl', 'wb') as f:
pickle.dump(model, f)
To Load :
with open('model.pkl', 'rb') as f:
model = pickle.load(f)
m = model.to(device)
exponentialXP commented
You can also use: torch.save()
and torch.load()
for the model and/or optimizer's state_dict()