How to load a released PL model in my directory?

Hello! I’m new to PyTorch Lightning. Recently, I am developing a PyTorch project. I want to run an open-source DeepSpeech code in Github and load its checkpoint. I clone their repository and run successfully. Then, I want to add their model to my project.
In PyTorch, this is easy. I only need to copy their model definition files and checkpoint files to my project directory. However, when I did these, I received an error when I ran load_from_checkpoint.

ModuleNotFoundError: No module named deepspeech_pytorch

Then, I try to directly call torch.load('librispeech_pretrained_v3.ckpt'). The error is still raised.
Thus, I was wondering if I can load their model in my own directory without copying their whole repository?

PTL’s checkpoint are not exactly the same as PyTorch’s save_model! Therefore, a simple torch.load won’t work.

You need some tricks to do so; it depends on how the model is defined. If you are passing the model as an argument, you might wanna look at the following post.

Or post a link to your colab notebook, and I will be happy to help you out (since the information provided isn’t enough).