If you make your model a subclass of PreTrainedModel, then you can use our methods save_pretrained and from_pretrained. Otherwise it’s regular PyTorch code to save and load (using torch.save and torch.load).
What if the pre-trained model is saved by using torch.save(model.state_dict()). How can I use that model like the BertTokenizer for creating tokens and also embeddings?
Hi,
Is there a difference between loading a model via torch.load and using from_pretrained in terms of downstream tasks?
Does either method have an advantage over the other for fine-tuning or inference?