tf_model.save_pretrained("path/to/awesome-name-you-picked")
```
and if you trained your model in TensorFlow and have to create a PyTorch version, adapt the following code to your
model class:
```python
pt_model = DistilBertForSequenceClassification.from_pretrained("path/to/awesome-name-you-picked", from_tf=True)
pt_model.save_pretrained("path/to/awesome-name-you-picked")
```
That's all there is to it!
Check the directory before pushing to the model hub.
Make sure there are no garbage files in the directory you'll upload. It should only have:
a config.json file, which saves the configuration of your model ;
a pytorch_model.bin file, which is the PyTorch checkpoint (unless you can't have it for some reason) ;
a tf_model.h5 file, which is the TensorFlow checkpoint (unless you can't have it for some reason) ;
