salesforce / awd-lstm-lm

LSTM and QRNN Language Model Toolkit for PyTorch
BSD 3-Clause "New" or "Revised" License
1.96k stars 488 forks source link

Weights sharing #57

Closed enod closed 6 years ago

enod commented 6 years ago

Hi guys! Thanks for sharing this awesome project.

I would like to share my weights similar to - asd-lstm weights. Is there any way I can do that?

enod commented 6 years ago

By using model.state_dict() i was able to get the weights.

To save model with it's weight - torch.save([model, criterion, optimizer, model.state_dict()], f) To load model, criterion, optimizer, state_dic = torch.load(f). f refers to model file that you saved to.