How do I load a pretrained file offline?
## ❓ Questions & Help

Hi, when I use "RobertaModel.from_pretrained(roberta.large)" to load model. A progress bar appears to download the pre-training model. I've already downloaded files like "roberta-large-pytorch_model.bin ". How can I stop automatically downloading files to the ".cache" folder and instead specify these pre-training files I downloaded?

You can do it, instead of loading `from_pretrained(roberta.large)` like this download the respective `config.json` and `<mode_name>.bin` and save it on your folder then just write 
`.from_pretrained('Users/<location>/<your folder name>')` and thats about it.<|||||>OK, Thank you very much!<|||||>@shashankMadan-designEsthetics' solution may require git-lfs to download the files of some models. If you are not a sudoer, this can be a problem. The most reliable and easy solution I've found is this:
```
from transformers import AutoModel, AutoTokenizer

# Do this on a machine with internet access
model = AutoModel.from_pretrained("model-name")
tokenizer = AutoTokenizer.from_pretrained("model-name")

_ = model.save_pretrained("./model-dir")
_ = tokenizer.save_pretrained("./model-dir")
```
Then you can do whatever you want with your model -- send it to a computing cluster, put it on a flash drive etc. Then you just do:
```
model = AutoModel.from_pretrained("path/model-dir")
tokenizer = AutoTokenizer.from_pretrained("path/model-dir")
```