# What does this PR do?

When using the `trust_remote_code=True` feature with local models (for instance using a clone of a repo with custom code) the custom code files are not copied over if the user does `save_pretrained` (as a result of #22814)  but they should in this specific case. This PR fixes that.

Fixes #24737 
Copy code when using local trust remote code. # What does this PR do?

When using the `trust_remote_code=True` feature with local models (for instance using a clone of a repo with custom code) the custom code files are not copied over if the user does `save_pretrained` (as a result of #22814)  but they should in this specific case. This PR fixes that.

Fixes #24737 