In pytorch, you could save the model with something like

torch.save(model.state_dict(),’/content/drive/My Drive/ftmodelname’ )

Then you could create a model using the pre-trained weights

tuned_model = BertForSequenceClassification.from_pretrained(‘bert-base-uncased’,
num_labels=NCLASSES,
output_attentions=True)

and then overwrite its weights from the saved state_dict with

tuned_model.load_state_dict(torch.load(’/content/drive/My Drive/ftmodelname’,
map_location=torch.device(“cpu”)),
strict=False)

I expect you could do a similar save of the model state_dict using Tensorflow.