You can “remove” the last linear layer by replacing them with an nn.Identity layer via:
model = var()
model.load_state_dict(torch.load(m_path))
model.last_linear_layer = nn.Identity()
...

Alternatively, you could also write a custom model implementation and skip this layer entirely, but based on your usage the replacement with Identity would be the simplest approach.