Instead of



 R00:

class Model(nn.Module):


you can do
class Model(PreTrainedModel):
This allows you to use the built-in save and load mechanisms. Instead of torch.save you can do model.save_pretrained("your-save-dir/) 1. After that you can load the model with Model.from_pretrained("your-save-dir/").