Retrain model remove last layer

I have a pytorch model with weights converted from tensorflow. I wanted to use it as a basis for new trainings.
I would like to use the model with these weights by eliminating the last layer and adding the new one with extra classes.
is it possible how what?