gmihaila / ml_things

This is where I put things I find useful that speed up my work with Machine Learning. Ever looked in your old projects to reuse those cool functions you created before? Well, this repo is designed to be a Python Library of functions I created in my previous project that can be reused. I also share some Notebooks Tutorials and Python Code Snippets.
https://gmihaila.github.io
Apache License 2.0
245 stars 61 forks source link

Making use of saved model #8

Closed Ghani-25 closed 2 years ago

Ghani-25 commented 3 years ago

Hello,

i am using pretrain_transformers_pytorch.ipynb, I have successfully followed all steps, my question is how to reload the pretrain_bert saved model to make us of it?

thank you

gmihaila commented 3 years ago

Hi @Ghani-25, Thank you for your question!

You will need to save the model at the end of the notebook. Next when you use in a different place just load it using the path where you saved the model.

Here is how you do it in PyTorch: https://pytorch.org/tutorials/beginner/saving_loading_models.html