The simpler approach would probably be to initialize the same pretrained model, load the state_dict, and reassign the last linear layer.
This would be the same workflow as if you would load a pretrained model from torchvision and just swap the last classifier for your own.
Using this approach you would avoid manipulating the state_dict.
Would that work for you?