Specify from_tf=True to convert a checkpoint from TensorFlow to PyTorch:

pt_model = DistilBertForSequenceClassification.from_pretrained("path/to/awesome-name-you-picked", from_tf=True)
pt_model.save_pretrained("path/to/awesome-name-you-picked")
``
</pt>
<tf>
Specifyfrom_pt=True` to convert a checkpoint from PyTorch to TensorFlow:

tf_model = TFDistilBertForSequenceClassification.from_pretrained("path/to/awesome-name-you-picked", from_pt=True)