The first one makes it so that the code of your model is also saved when you do model.save_pretrained
so it can be re-used by another user (it’s the code on the Hub feature).
The second one allows you to use your custom model with the auto-API (but doesn’t share any custom code with other users).