Downloading transformers models to use offline
I have a trained transformers NER model that I want to use on a machine not connected to the internet. When loading such a model, currently it downloads cache files to the .cache folder. 

To load and run the model offline, you need to copy the files in the .cache folder to the offline machine. However, these files have long, non-descriptive names, which makes it really hard to identify the correct files if you have multiple models you want to use. Any thoughts on this?

Example of model files

One relatively easy way to deal with this issue is to simply &quot;rename&quot; the pretrained models, as is detailed in this thread.
Essentially, all you have to do is something like this for whatever model you're trying to work with:
from transformers import BertModel

model = BertModel.from_pretrained(&quot;bert-base-uncased&quot;)
model.save_pretrained(&quot;./my_named_bert&quot;)

The thread also details how the local model folders are named, see LysandreJik's post:

Hi, they are named as such because that's a clean way to make sure the model on the S3 is the same as the model in the cache. The name is created from the etag of the file hosted on the S3. [...]

