import datetime
def savemodel(model,name):
formatted_date = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M')
# Save the model checkpoint
torch.save(model.state_dict(), './savemodel%s_%s_withoutembedding.ckpt'%(name,formatted_date))
def loadmodel(model,path):
model_state=torch.load(path)
model.load_state_dict(model_state)
return model