make internet connection only if local cache is missing
### Feature request

Check if local cache has the model, and download the model only if have to.

### Motivation

My connection to github or huggingface is unstable. I don't want make this unstable internet connection if I can find the cache of the model, breaking things and logics.

### Your contribution

I already mentioned it at #2867. I also made some changes at #20876
hi james, can you assign this issue to me?<|||||>Thanks for opening this issue, but we're not interested in implementing this feature as this would break the auto-update mechanism (if someone updates the model, it would no longer be downloaded).

If the connection fails for any reason, local files are used instead.<|||||>okay, no problem, i'll look for another issue, which i can fix.
thanx for replying.<|||||>> this would break the auto-update mechanism

In the code the default value of this parameter is set to "False", so it won't be turned on unless you set it to "True".

Auto-updating model is not always needed, though by default it will check for updates everytime.<|||||>It's based on the "local_files_only" #2930, which will skip updates after all.<|||||>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/main/CONTRIBUTING.md) are likely to be ignored.<|||||>I've made some updates on my fork, though might be incomplete, shall cover most cases on model loading.<|||||>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/main/CONTRIBUTING.md) are likely to be ignored.