santacoder: saved checkpoints after fine-tuning do not have required .py files
### System Info

- `transformers` version: 4.25.1
- Platform: Linux-3.10.0-1160.49.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.12
- Huggingface_hub version: 0.11.1
- PyTorch version (GPU?): 1.12.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

The santacoder model uses `trust_remote_code=True` to load Python files from the model repository. However, when I fine-tune a model and save a checkpoint, these Python files are not placed in the repository. Thus I get an error when trying to load the saved checkpoint. Here is the smallest program that shows the problem:

```python
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("bigcode/santacoder", revision="dedup-alt-comments", trust_remote_code=True)
model.save_pretrained("./silly-checkpoint")
model = AutoModelForCausalLM.from_pretrained(f"./silly-checkpoint", trust_remote_code=True, revision="dedup-alt-comments")
```

This produces the error `Could not locate the configuration_gpt2_mq.py inside ./silly-checkpoint.`

I can work around it by manually downloading the two Python files from the model repository:

https://huggingface.co/bigcode/santacoder/tree/dedup-alt-comments

But, this should probably not be necessary.

### Expected behavior

I think my script should work as-is, and should not require copy-pasta Python code.
Thanks for reporting! I'll have a look into it after the holidays, the first week of January.<|||||>Thanks for your patience. Could you try the PR linked above?<|||||>I'm away this week. But, I'll check it out next week. Thanks!