Copy of the custom modeling file when saving a model
Hi,

When using the dynamic code loading feature #13467 , the custom modeling file (eg: modeling.py) isn't copied into the folder when you save the model. 
In this case, you have to manually copy the file to the folder to be able to reload the model from the checkpoint.

Code example:
```
from transformers import AutoModel, AutoTokenizer

# Load a model from the hub with a custom modeling file
model = AutoModel.from_pretrained("ccdv/lsg-base-4096", trust_remote_code=True)
model.save_pretrained("saved_model")

# Fail to reload since the file isn't in the folder
model = AutoModel.from_pretrained("saved_model", trust_remote_code=True) 
```

Any plan to fix this ?

Thank you




Yes, there are plans to couple this we the `AutoXxx.register` API so that when you register a new architecture, the custom code is copied to the right places when doing `save_pretrained`. I'm hoping to get to this by the end of the week.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.<|||||>This should have been addressed by #15379, see the description of this PR or the new [doc page](https://huggingface.co/docs/transformers/master/en/custom_models) for more information!<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.